style: fix formatting

This commit is contained in:
Stefano Amorelli
2025-08-17 14:03:42 +03:00
parent 12706424e3
commit f29f1203aa
2 changed files with 3 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ use std::path::Path;
fn parse_sample_sec_file(c: &mut Criterion) {
let parser = Parser::new();
let sample_file = Path::new("fixtures/sample-sec.xml");
if sample_file.exists() {
c.bench_function("parse_sample_sec", |b| {
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>
</unit>
</xbrl>"#;
c.bench_function("parse_minimal", |b| {
b.iter(|| parser.parse_str(black_box(minimal_xbrl)));
});

View File

@@ -17,7 +17,7 @@ impl Parser {
pub fn parse_str(&self, content: &str) -> Result<Document> {
self.parse_bytes(content.as_bytes())
}
pub fn parse_file<P: AsRef<Path>>(&self, path: P) -> Result<Document> {
let content = std::fs::read(path)?;
self.parse_bytes(&content)