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:
Lux Aliaga 2023-08-28 02:03:29 -04:00
parent 2b8126eb53
commit 73ef278372
1 changed files with 2 additions and 2 deletions

View File

@ -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 {