style: add rustfmt config and fix spacing

- Add .rustfmt.toml for consistent formatting
- Fix blank line spacing in lib.rs
- Remove trailing spaces from doc comments
This commit is contained in:
Stefano Amorelli
2025-08-17 13:30:09 +03:00
parent 84ec605708
commit 26f147c0de
2 changed files with 6 additions and 4 deletions

2
.rustfmt.toml Normal file
View File

@@ -0,0 +1,2 @@
# Rust formatting configuration
edition = "2021"

View File

@@ -1,5 +1,5 @@
//! crabrl - High-performance XBRL parser and validator //! crabrl - High-performance XBRL parser and validator
//! //!
//! Licensed under AGPL-3.0 //! Licensed under AGPL-3.0
pub mod model; pub mod model;
@@ -26,7 +26,7 @@ impl Validator {
strict: false, strict: false,
} }
} }
pub fn with_config(config: ValidationConfig) -> Self { pub fn with_config(config: ValidationConfig) -> Self {
let mut inner = validator::XbrlValidator::new(); let mut inner = validator::XbrlValidator::new();
if config.strict { if config.strict {
@@ -37,14 +37,14 @@ impl Validator {
strict: config.strict, strict: config.strict,
} }
} }
pub fn sec_edgar() -> Self { pub fn sec_edgar() -> Self {
Self { Self {
inner: validator::XbrlValidator::new().strict(), inner: validator::XbrlValidator::new().strict(),
strict: true, strict: true,
} }
} }
pub fn validate(&self, doc: &Document) -> Result<ValidationResult> { pub fn validate(&self, doc: &Document) -> Result<ValidationResult> {
let start = std::time::Instant::now(); let start = std::time::Instant::now();