aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-spdx-licenses/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-22 15:24:18 +0900
committernsfisis <nsfisis@gmail.com>2026-02-22 15:24:21 +0900
commitf7f1ae38b765a10cb37fb2ecc68daea3401954fd (patch)
tree071cb8062b6da2159859d4e4fc550ac47e11a346 /crates/mozart-spdx-licenses/src
parent7f75c394502d32a9a8967dcf3602141098fdd07d (diff)
downloadphp-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.rs15
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]