[No-auto] bin/core/imag: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
670a0ff6d7
commit
3a1f0dde9d
1 changed files with 62 additions and 67 deletions
|
@ -102,8 +102,7 @@ fn help_text(cmds: Vec<String>) -> String {
|
|||
.into_iter()
|
||||
.map(|cmd| format!("\t{}\n", cmd))
|
||||
.fold(String::new(), |s, c| {
|
||||
let s = s + c.as_str();
|
||||
s
|
||||
s + c.as_str()
|
||||
}))
|
||||
}
|
||||
|
||||
|
@ -270,9 +269,9 @@ fn main() {
|
|||
}
|
||||
};
|
||||
|
||||
// Matches any subcommand given
|
||||
match matches.subcommand() {
|
||||
(subcommand, Some(scmd)) => {
|
||||
// Matches any subcommand given, except calling for example 'imag --versions', as this option
|
||||
// does not exit. There's nothing to do in such a case
|
||||
if let (subcommand, Some(scmd)) = matches.subcommand() {
|
||||
// Get all given arguments and further subcommands to pass to
|
||||
// the imag-<> binary
|
||||
// Providing no arguments is OK, and is therefore ignored here
|
||||
|
@ -334,10 +333,6 @@ fn main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// Calling for example 'imag --versions' will lead here, as this option does not exit.
|
||||
// There's nothing to do in such a case
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -353,14 +348,14 @@ fn fetch_aliases(config: Option<&Value>) -> Result<BTreeMap<String, String>, Str
|
|||
let mut alias_mappings = BTreeMap::new();
|
||||
|
||||
for (k, v) in tbl {
|
||||
match v {
|
||||
&Value::String(ref alias) => {
|
||||
match *v {
|
||||
Value::String(ref alias) => {
|
||||
alias_mappings.insert(alias.clone(), k.clone());
|
||||
},
|
||||
&Value::Array(ref aliases) => {
|
||||
Value::Array(ref aliases) => {
|
||||
for alias in aliases {
|
||||
match alias {
|
||||
&Value::String(ref s) => {
|
||||
match *alias {
|
||||
Value::String(ref s) => {
|
||||
alias_mappings.insert(s.clone(), k.clone());
|
||||
},
|
||||
_ => {
|
||||
|
|
Loading…
Reference in a new issue