Address all clippy lints

These changes do not change the behaviour of the
code and should be non-controversial.
This commit is contained in:
Alexander Theißen
2020-10-13 13:44:05 +02:00
parent f59eb121e5
commit c09a924a81
18 changed files with 249 additions and 256 deletions
+9 -9
View File
@@ -28,12 +28,12 @@ pub enum Error {
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
use self::Error::*;
match *self {
Io(ref io) => write!(f, "Generic i/o error: {}", io),
FailedToCopy(ref msg) => write!(f, "{}. Have you tried to run \"cargo build\"?", msg),
Decoding(ref err, ref file) => write!(f, "Decoding error ({}). Must be a valid wasm file {}. Pointed wrong file?", err, file),
Encoding(ref err) => write!(f, "Encoding error ({}). Almost impossible to happen, no free disk space?", err),
Build(ref err) => write!(f, "Build error: {}", err)
match self {
Io(io) => write!(f, "Generic i/o error: {}", io),
FailedToCopy(msg) => write!(f, "{}. Have you tried to run \"cargo build\"?", msg),
Decoding(err, file) => write!(f, "Decoding error ({}). Must be a valid wasm file {}. Pointed wrong file?", err, file),
Encoding(err) => write!(f, "Encoding error ({}). Almost impossible to happen, no free disk space?", err),
Build(err) => write!(f, "Build error: {}", err)
}
}
}
@@ -163,9 +163,9 @@ fn do_main() -> Result<(), Error> {
None
};
let public_api_entries = matches.value_of("public_api")
.map(|val| val.split(",").collect())
.unwrap_or(Vec::new());
let public_api_entries: Vec<_> = matches.value_of("public_api")
.map(|val| val.split(',').collect())
.unwrap_or_default();
let target_runtime = match matches.value_of("target-runtime").expect("target-runtime has a default value; qed") {
"pwasm" => TargetRuntime::pwasm(),
+2 -2
View File
@@ -17,8 +17,8 @@ pub struct SourceInput<'a> {
impl<'a> SourceInput<'a> {
pub fn new<'b>(target_dir: &'b str, bin_name: &'b str) -> SourceInput<'b> {
SourceInput {
target_dir: target_dir,
bin_name: bin_name,
target_dir,
bin_name,
final_name: bin_name,
target: SourceTarget::Emscripten,
}