From a1c7e6908a26e10f6e1f23a51721664b5e2d838d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 17 May 2026 02:53:53 +0900 Subject: chore(style): cargo fmt --- crates/shirabe-class-map-generator/src/class_map.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'crates/shirabe-class-map-generator/src/class_map.rs') diff --git a/crates/shirabe-class-map-generator/src/class_map.rs b/crates/shirabe-class-map-generator/src/class_map.rs index 51d2bef..311924b 100644 --- a/crates/shirabe-class-map-generator/src/class_map.rs +++ b/crates/shirabe-class-map-generator/src/class_map.rs @@ -1,8 +1,10 @@ //! ref: composer/vendor/composer/class-map-generator/src/ClassMap.php use indexmap::IndexMap; -use shirabe_php_shim::{Countable, InvalidArgumentException, OutOfBoundsException, rtrim, strpos, strtr}; use shirabe_external_packages::composer::pcre::preg::Preg; +use shirabe_php_shim::{ + Countable, InvalidArgumentException, OutOfBoundsException, rtrim, strpos, strtr, +}; #[derive(Debug, Clone)] pub struct PsrViolationEntry { @@ -105,20 +107,25 @@ impl ClassMap { self.psr_violations .entry(path) .or_default() - .push(PsrViolationEntry { warning, class_name }); + .push(PsrViolationEntry { + warning, + class_name, + }); } pub fn clear_psr_violations_by_path(&mut self, path_prefix: &str) { let path_prefix = rtrim(&strtr(path_prefix, "\\", "/"), Some("/")); self.psr_violations.retain(|path, _| { - path != &path_prefix - && strpos(path, &format!("{}/", path_prefix)) != Some(0) + path != &path_prefix && strpos(path, &format!("{}/", path_prefix)) != Some(0) }); } pub fn add_ambiguous_class(&mut self, class_name: String, path: String) { - self.ambiguous_classes.entry(class_name).or_default().push(path); + self.ambiguous_classes + .entry(class_name) + .or_default() + .push(path); } /// Get the raw psr violations -- cgit v1.3.1