Fix clippy warnings.
This commit fixes the current set of (stable) clippy warnings in the repo.
This commit is contained in:
committed by
Andrew Brown
parent
1176e4f178
commit
9f506692c2
@@ -81,7 +81,7 @@ fn gen_to_and_from_str(name: &str, values: &[&'static str], fmt: &mut Formatter)
|
||||
fmtln!(fmt, "f.write_str(match *self {");
|
||||
fmt.indent(|fmt| {
|
||||
for v in values.iter() {
|
||||
fmtln!(fmt, "{}::{} => \"{}\",", name, camel_case(v), v);
|
||||
fmtln!(fmt, "Self::{} => \"{}\",", camel_case(v), v);
|
||||
}
|
||||
});
|
||||
fmtln!(fmt, "})");
|
||||
@@ -98,7 +98,7 @@ fn gen_to_and_from_str(name: &str, values: &[&'static str], fmt: &mut Formatter)
|
||||
fmtln!(fmt, "match s {");
|
||||
fmt.indent(|fmt| {
|
||||
for v in values.iter() {
|
||||
fmtln!(fmt, "\"{}\" => Ok({}::{}),", v, name, camel_case(v));
|
||||
fmtln!(fmt, "\"{}\" => Ok(Self::{}),", v, camel_case(v));
|
||||
}
|
||||
fmtln!(fmt, "_ => Err(()),");
|
||||
});
|
||||
@@ -198,7 +198,7 @@ fn gen_getters(group: &SettingGroup, fmt: &mut Formatter) {
|
||||
});
|
||||
fmtln!(fmt, "}");
|
||||
|
||||
if group.settings.len() > 0 {
|
||||
if !group.settings.is_empty() {
|
||||
fmt.doc_comment("Dynamic numbered predicate getter.");
|
||||
fmtln!(fmt, "fn numbered_predicate(&self, p: usize) -> bool {");
|
||||
fmt.indent(|fmt| {
|
||||
|
||||
Reference in New Issue
Block a user