diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:53:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:53:53 +0900 |
| commit | a1c7e6908a26e10f6e1f23a51721664b5e2d838d (patch) | |
| tree | c575c76f1b43359ed74913da4c6a2636643f1ba0 /crates/shirabe-semver/src/compiling_matcher.rs | |
| parent | 7f606f36fef0c0467c3c0db3d0da33af486dae8a (diff) | |
| download | php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.gz php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.zst php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.zip | |
chore(style): cargo fmt
Diffstat (limited to 'crates/shirabe-semver/src/compiling_matcher.rs')
| -rw-r--r-- | crates/shirabe-semver/src/compiling_matcher.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/shirabe-semver/src/compiling_matcher.rs b/crates/shirabe-semver/src/compiling_matcher.rs index 7fb17ec..f6a3689 100644 --- a/crates/shirabe-semver/src/compiling_matcher.rs +++ b/crates/shirabe-semver/src/compiling_matcher.rs @@ -27,8 +27,8 @@ static TRANS_OP_INT: &[(i64, &str)] = &[ pub struct CompilingMatcher; impl CompilingMatcher { - fn compiled_checker_cache( - ) -> &'static Mutex<IndexMap<String, Box<dyn Fn(String, bool) -> bool + Send + Sync>>> { + fn compiled_checker_cache() + -> &'static Mutex<IndexMap<String, Box<dyn Fn(String, bool) -> bool + Send + Sync>>> { COMPILED_CHECKER_CACHE.get_or_init(|| Mutex::new(IndexMap::new())) } @@ -42,8 +42,7 @@ impl CompilingMatcher { } pub fn r#match(constraint: &dyn ConstraintInterface, operator: i64, version: String) -> bool { - let result_cache_key = - format!("{}{};{}", operator, constraint.__to_string(), version); + let result_cache_key = format!("{}{};{}", operator, constraint.__to_string(), version); { let cache = Self::result_cache().lock().unwrap(); @@ -59,7 +58,10 @@ impl CompilingMatcher { .expect("unknown operator"); let result = constraint.matches(&Constraint::new(trans_op.to_string(), version)); - Self::result_cache().lock().unwrap().insert(result_cache_key, result); + Self::result_cache() + .lock() + .unwrap() + .insert(result_cache_key, result); result } } |
