diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-22 15:24:18 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-22 15:24:21 +0900 |
| commit | f7f1ae38b765a10cb37fb2ecc68daea3401954fd (patch) | |
| tree | 071cb8062b6da2159859d4e4fc550ac47e11a346 /crates/mozart-spdx-licenses/src | |
| parent | 7f75c394502d32a9a8967dcf3602141098fdd07d (diff) | |
| download | php-mozart-f7f1ae38b765a10cb37fb2ecc68daea3401954fd.tar.gz php-mozart-f7f1ae38b765a10cb37fb2ecc68daea3401954fd.tar.zst php-mozart-f7f1ae38b765a10cb37fb2ecc68daea3401954fd.zip | |
chore: cargo fmt
Diffstat (limited to 'crates/mozart-spdx-licenses/src')
| -rw-r--r-- | crates/mozart-spdx-licenses/src/lib.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/crates/mozart-spdx-licenses/src/lib.rs b/crates/mozart-spdx-licenses/src/lib.rs index 04dce27..81fa329 100644 --- a/crates/mozart-spdx-licenses/src/lib.rs +++ b/crates/mozart-spdx-licenses/src/lib.rs @@ -164,11 +164,7 @@ struct Parser<'a> { impl<'a> Parser<'a> { fn new(input: &'a str, db: &'a SpdxLicenses) -> Self { let tokens = Self::tokenize(input); - Self { - tokens, - pos: 0, - db, - } + Self { tokens, pos: 0, db } } fn tokenize(input: &str) -> Vec<&str> { @@ -332,7 +328,9 @@ impl<'a> Parser<'a> { /// Check that a string matches `[a-zA-Z0-9.-]+`. fn is_valid_idstring(s: &str) -> bool { - !s.is_empty() && s.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'.' || b == b'-') + !s.is_empty() + && s.bytes() + .all(|b| b.is_ascii_alphanumeric() || b == b'.' || b == b'-') } #[cfg(test)] @@ -451,10 +449,7 @@ mod tests { #[test] fn name_lookup() { let db = spdx(); - assert_eq!( - db.get_identifier_by_name("MIT License"), - Some("MIT") - ); + assert_eq!(db.get_identifier_by_name("MIT License"), Some("MIT")); } #[test] |
