mirror of
https://github.com/stefanoamorelli/crabrl.git
synced 2026-04-18 07:10:42 +00:00
style: fix formatting
This commit is contained in:
@@ -5,7 +5,7 @@ use std::path::Path;
|
|||||||
fn parse_sample_sec_file(c: &mut Criterion) {
|
fn parse_sample_sec_file(c: &mut Criterion) {
|
||||||
let parser = Parser::new();
|
let parser = Parser::new();
|
||||||
let sample_file = Path::new("fixtures/sample-sec.xml");
|
let sample_file = Path::new("fixtures/sample-sec.xml");
|
||||||
|
|
||||||
if sample_file.exists() {
|
if sample_file.exists() {
|
||||||
c.bench_function("parse_sample_sec", |b| {
|
c.bench_function("parse_sample_sec", |b| {
|
||||||
b.iter(|| parser.parse_file(black_box(&sample_file)));
|
b.iter(|| parser.parse_file(black_box(&sample_file)));
|
||||||
@@ -26,7 +26,7 @@ fn parse_sample_sec_file(c: &mut Criterion) {
|
|||||||
<measure>iso4217:USD</measure>
|
<measure>iso4217:USD</measure>
|
||||||
</unit>
|
</unit>
|
||||||
</xbrl>"#;
|
</xbrl>"#;
|
||||||
|
|
||||||
c.bench_function("parse_minimal", |b| {
|
c.bench_function("parse_minimal", |b| {
|
||||||
b.iter(|| parser.parse_str(black_box(minimal_xbrl)));
|
b.iter(|| parser.parse_str(black_box(minimal_xbrl)));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ impl Parser {
|
|||||||
pub fn parse_str(&self, content: &str) -> Result<Document> {
|
pub fn parse_str(&self, content: &str) -> Result<Document> {
|
||||||
self.parse_bytes(content.as_bytes())
|
self.parse_bytes(content.as_bytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_file<P: AsRef<Path>>(&self, path: P) -> Result<Document> {
|
pub fn parse_file<P: AsRef<Path>>(&self, path: P) -> Result<Document> {
|
||||||
let content = std::fs::read(path)?;
|
let content = std::fs::read(path)?;
|
||||||
self.parse_bytes(&content)
|
self.parse_bytes(&content)
|
||||||
|
|||||||
Reference in New Issue
Block a user