mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-05 12:27:53 +00:00
Improve code in two insignificant little places
This commit is contained in:
parent
9218799e6e
commit
c543e61ced
@ -425,7 +425,7 @@ impl Default for SortField {
|
||||
impl OptionSet for SortField {
|
||||
fn deduce(matches: &getopts::Matches) -> Result<SortField, Misfire> {
|
||||
if let Some(word) = matches.opt_str("sort") {
|
||||
match &word[..] {
|
||||
match &*word {
|
||||
"name" | "filename" => Ok(SortField::Name),
|
||||
"size" | "filesize" => Ok(SortField::Size),
|
||||
"ext" | "extension" => Ok(SortField::Extension),
|
||||
@ -519,13 +519,11 @@ impl OptionSet for TimeTypes {
|
||||
otherwise => Err(Misfire::bad_argument("time", otherwise)),
|
||||
}
|
||||
}
|
||||
else if modified || created || accessed {
|
||||
Ok(TimeTypes { accessed: accessed, modified: modified, created: created })
|
||||
}
|
||||
else {
|
||||
if modified || created || accessed {
|
||||
Ok(TimeTypes { accessed: accessed, modified: modified, created: created })
|
||||
}
|
||||
else {
|
||||
Ok(TimeTypes::default())
|
||||
}
|
||||
Ok(TimeTypes::default())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user