Skip to content

Commit

Permalink
Fix issues pointed out by Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb committed Jan 12, 2025
1 parent 4ef9b15 commit 511c222
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/args/dir_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl DirGroup {
.args
.exclude
.as_ref()
.map_or(false, |pat| pat.is_match(haystack));
.is_some_and(|pat| pat.is_match(haystack));
if exclude {
debug!("Name {name:?} matched `--exclude`.");
return None;
Expand Down
4 changes: 2 additions & 2 deletions src/enums/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ impl Icon {
.unwrap_or(1.0f32)
.min(2.0); // We only allocate two cells for an icon.

return (scale * PLS.window.as_ref().unwrap().cell_width() as f32) // Convert to px.s
.round() as u8;
(scale * PLS.window.as_ref().unwrap().cell_width() as f32) // Convert to px.s
.round() as u8
}

/// Get the output of the icon using the appropriate method:
Expand Down
2 changes: 1 addition & 1 deletion src/enums/sym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum SymTarget<'node> {
Error(Exc), // Target cannot be determined.
}

impl<'node> SymTarget<'node> {
impl SymTarget<'_> {
/// Print the symlink target.
pub fn print(&self, conf: &Conf) -> String {
let state = self.into();
Expand Down
2 changes: 1 addition & 1 deletion src/fmt/markup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ where
F: Fn(char) -> bool,
{
let mut selected = String::new();
while tokens.peek().map_or(false, |ch| predicate(*ch)) {
while tokens.peek().is_some_and(|ch| predicate(*ch)) {
selected.push(tokens.next().unwrap());
}
selected
Expand Down
2 changes: 1 addition & 1 deletion src/models/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl OwnerMan {
entity: Entity::Group,
id: gid,
name: Some(group.name().to_string_lossy().into()),
is_curr: self.curr_user.clone().map_or(false, |user| {
is_curr: self.curr_user.clone().is_some_and(|user| {
group
.members()
.iter()
Expand Down

0 comments on commit 511c222

Please sign in to comment.