diff options
Diffstat (limited to 'crates/shirabe/src/package/comparer')
| -rw-r--r-- | crates/shirabe/src/package/comparer/comparer.rs | 8 | ||||
| -rw-r--r-- | crates/shirabe/src/package/comparer/mod.rs | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/crates/shirabe/src/package/comparer/comparer.rs b/crates/shirabe/src/package/comparer/comparer.rs index 73c94f4..d23e669 100644 --- a/crates/shirabe/src/package/comparer/comparer.rs +++ b/crates/shirabe/src/package/comparer/comparer.rs @@ -12,6 +12,12 @@ pub struct Comparer { changed: IndexMap<String, Vec<String>>, } +impl Default for Comparer { + fn default() -> Self { + Self::new() + } +} + impl Comparer { pub fn new() -> Self { Self { @@ -96,7 +102,7 @@ impl Comparer { } for (dir, value) in &destination { for (file, _hash) in value { - if !source.get(dir).map_or(false, |d| d.contains_key(file)) { + if !source.get(dir).is_some_and(|d| d.contains_key(file)) { self.changed .entry("added".to_string()) .or_default() diff --git a/crates/shirabe/src/package/comparer/mod.rs b/crates/shirabe/src/package/comparer/mod.rs index d6ce6cb..878d7e0 100644 --- a/crates/shirabe/src/package/comparer/mod.rs +++ b/crates/shirabe/src/package/comparer/mod.rs @@ -1,3 +1,4 @@ +#[allow(clippy::module_inception, reason = "to port PHP's structure as it is")] pub mod comparer; pub use comparer::*; |
