Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricziel committed Sep 7, 2024
1 parent db2d93a commit 9d8abae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion composer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,17 @@ pub struct ComposerBasePackage {
}

impl ComposerBasePackage {
#[must_use]
pub fn get_script(&self, key: &str) -> Option<&ScriptValue> {
self.scripts.as_ref().and_then(|scripts| scripts.get(key))
}

#[must_use]
pub fn scripts_len(&self) -> usize {
self.scripts.as_ref().map_or(0, |scripts| scripts.len())
self.scripts.as_ref().map_or(0, HashMap::len)
}

#[must_use]
pub fn has_script(&self, key: &str) -> bool {
self.scripts.as_ref().map_or(false, |scripts| scripts.contains_key(key))
}
Expand Down

0 comments on commit 9d8abae

Please sign in to comment.