cargo clippy
This commit is contained in:
@@ -397,26 +397,22 @@ pub fn parse(input: &str) -> Option<Command> {
|
||||
"added" => Some(SortKey::Added),
|
||||
"artist" => Some(SortKey::Artist),
|
||||
_ => None,
|
||||
});
|
||||
|
||||
if sort_key.is_none() {
|
||||
return None;
|
||||
}
|
||||
})?;
|
||||
|
||||
let sort_direction = args
|
||||
.get(1)
|
||||
.and_then(|direction| match *direction {
|
||||
"a" => Some(SortDirection::Ascending),
|
||||
"asc" => Some(SortDirection::Ascending),
|
||||
"ascending" => Some(SortDirection::Ascending),
|
||||
"d" => Some(SortDirection::Descending),
|
||||
"desc" => Some(SortDirection::Descending),
|
||||
"descending" => Some(SortDirection::Descending),
|
||||
_ => Some(SortDirection::Ascending),
|
||||
.map(|direction| match *direction {
|
||||
"a" => SortDirection::Ascending,
|
||||
"asc" => SortDirection::Ascending,
|
||||
"ascending" => SortDirection::Ascending,
|
||||
"d" => SortDirection::Descending,
|
||||
"desc" => SortDirection::Descending,
|
||||
"descending" => SortDirection::Descending,
|
||||
_ => SortDirection::Ascending,
|
||||
})
|
||||
.unwrap_or(SortDirection::Ascending);
|
||||
|
||||
Some(Command::Sort(sort_key.unwrap(), sort_direction))
|
||||
Some(Command::Sort(sort_key, sort_direction))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ impl ContextMenu {
|
||||
true => "Unsave track",
|
||||
false => "Save track",
|
||||
},
|
||||
ContextMenuAction::ToggleTrackSavedStatus(Box::new(t.clone())),
|
||||
ContextMenuAction::ToggleTrackSavedStatus(Box::new(t)),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ impl ViewExt for PlaylistView {
|
||||
|
||||
if let Command::Sort(key, direction) = cmd {
|
||||
self.list.sort(key, direction);
|
||||
return Ok(CommandResult::Consumed(None))
|
||||
return Ok(CommandResult::Consumed(None));
|
||||
}
|
||||
|
||||
self.list.on_command(s, cmd)
|
||||
|
||||
Reference in New Issue
Block a user