mirror of https://git.sr.ht/~nixgoat/vento
inv: Use is_empty() method for empty comparisons
This was suggested by cargo-clippy. Instead of comparing against "", it's better use the method is_empty() to determine if the dir argument in the list() function is not empty.
This commit is contained in:
parent
2b8126eb53
commit
73ef278372
|
@ -93,7 +93,7 @@ pub fn list(slot: &str, dir: &str, display_slot: bool) -> Result<()> {
|
|||
append_emoji(EmojiType::Inventory)?,
|
||||
format!(
|
||||
"No files in {}{}",
|
||||
if display_slot || dir != "" {
|
||||
if display_slot || !dir.is_empty() {
|
||||
match slot {
|
||||
"active" => slot.bold(),
|
||||
_ => slot.blue().bold(),
|
||||
|
@ -119,7 +119,7 @@ pub fn list(slot: &str, dir: &str, display_slot: bool) -> Result<()> {
|
|||
append_emoji(EmojiType::Inventory)?,
|
||||
format!(
|
||||
"Files in{}{} ({}):",
|
||||
if display_slot || dir != "" {
|
||||
if display_slot || !dir.is_empty() {
|
||||
format!(
|
||||
" {}",
|
||||
match slot {
|
||||
|
|
Loading…
Reference in New Issue