Fix clippy warnings

This commit is contained in:
Luni-4
2021-01-04 17:36:52 +01:00
parent 5698270518
commit 3a352e92a5
4 changed files with 6 additions and 5 deletions
+1
View File
@@ -58,6 +58,7 @@ impl error::Error for Error {
/// Use rustc to expand and pretty print the crate into a single file,
/// removing any macros in the process.
#[allow(clippy::too_many_arguments)]
pub fn expand(
manifest_path: &Path,
crate_name: &str,
+2 -2
View File
@@ -1141,7 +1141,7 @@ impl Enum {
write!(out, "{} ", attrs);
}
}};
};
}
write_attrs!("constructor");
write!(out, "static {} {}(", self.export_name, variant.export_name);
@@ -1297,7 +1297,7 @@ impl Enum {
write!(out, "{} ", attrs);
}
}};
};
}
if self.can_derive_eq() && config.structure.derive_eq(&self.annotations) {
out.new_line();
+2 -2
View File
@@ -61,7 +61,7 @@ impl Function {
never_return = true;
Type::Primitive(PrimitiveType::Void)
} else {
Type::load(ty)?.unwrap_or_else(|| Type::Primitive(PrimitiveType::Void))
Type::load(ty)?.unwrap_or(Type::Primitive(PrimitiveType::Void))
}
}
};
@@ -328,7 +328,7 @@ impl Source for Function {
out.write(";");
condition.write_after(config, out);
};
}
let option_1 = out.measure(|out| write_1(self, config, out));
+1 -1
View File
@@ -645,7 +645,7 @@ impl Source for Struct {
out.write(";");
out.close_brace(false);
}};
};
}
if config.structure.derive_eq(&self.annotations) && self.can_derive_eq() {
emit_op!("eq", "==", "&&");