From a38d103d7d68a6b845499d457cb0093f0a752c51 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Mon, 24 Mar 2025 00:14:13 +0200 Subject: [PATCH] non-abbreviated function names --- src/model.rs | 2 +- src/model/entry.rs | 6 +++--- src/view.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/model.rs b/src/model.rs index c9a441a..c9cf5d3 100644 --- a/src/model.rs +++ b/src/model.rs @@ -43,7 +43,7 @@ pub(crate) fn entries_under ( if let Some(path) = path { let mut others = vec![]; for other in entries.iter_mut() { - if other.path.starts_with(&path) && !other.is_dir() { + if other.path.starts_with(&path) && !other.is_directory() { others.push(other.info.clone()); } } diff --git a/src/model/entry.rs b/src/model/entry.rs index 3c04021..47a522f 100644 --- a/src/model/entry.rs +++ b/src/model/entry.rs @@ -38,13 +38,13 @@ impl Entry { path: path.into(), })) } - pub fn is_dir (&self) -> bool { + pub fn is_directory (&self) -> bool { matches!(&*self.info.read().unwrap(), Metadata::Directory { .. }) } - pub fn is_mus (&self) -> bool { + pub fn is_music (&self) -> bool { matches!(&*self.info.read().unwrap(), Metadata::Music { .. }) } - pub fn is_img (&self) -> bool { + pub fn is_image (&self) -> bool { matches!(&*self.info.read().unwrap(), Metadata::Image { .. }) } pub fn hash (&self) -> Option> { diff --git a/src/view.rs b/src/view.rs index 54871c9..df9dadd 100644 --- a/src/view.rs +++ b/src/view.rs @@ -83,11 +83,11 @@ impl Entry { Some(format!("{indent}{icon} {name}").into()) } fn icon (&self) -> &'static str { - if self.is_dir() { + if self.is_directory() { Self::ICON_DIRECTORY - } else if self.is_img() { + } else if self.is_image() { Self::ICON_IMAGE - } else if self.is_mus() { + } else if self.is_music() { Self::ICON_MUSIC } else { Self::ICON_UNKNOWN