chore: clippy warnings

This commit is contained in:
rvcas
2022-12-15 22:05:49 -05:00
committed by Lucas
parent ac14512706
commit b3266fb837
12 changed files with 24 additions and 30 deletions

View File

@@ -135,7 +135,7 @@ Find more on the [Aiken's user manual](https://aiken-lang.org).
}
fn write(path: PathBuf, contents: &str) -> miette::Result<()> {
let mut f = fs::File::create(&path).into_diagnostic()?;
let mut f = fs::File::create(path).into_diagnostic()?;
f.write_all(contents.as_bytes()).into_diagnostic()?;
Ok(())

View File

@@ -32,7 +32,7 @@ pub fn exec(
let mut program = if cbor {
let cbor_hex = std::fs::read_to_string(&script).into_diagnostic()?;
let raw_cbor = hex::decode(&cbor_hex).into_diagnostic()?;
let raw_cbor = hex::decode(cbor_hex).into_diagnostic()?;
let prog = Program::<FakeNamedDeBruijn>::from_cbor(&raw_cbor, &mut Vec::new())
.into_diagnostic()?;

View File

@@ -61,7 +61,7 @@ pub fn exec(
format!("{}.flat", input.file_stem().unwrap().to_str().unwrap())
};
fs::write(&out_name, &bytes).into_diagnostic()?;
fs::write(out_name, &bytes).into_diagnostic()?;
}
} else {
let cbor = program.to_hex().into_diagnostic()?;
@@ -75,7 +75,7 @@ pub fn exec(
format!("{}.cbor", input.file_stem().unwrap().to_str().unwrap())
};
fs::write(&out_name, &cbor).into_diagnostic()?;
fs::write(out_name, &cbor).into_diagnostic()?;
}
}

View File

@@ -55,7 +55,7 @@ pub fn exec(
format!("{}.uplc", input.file_stem().unwrap().to_str().unwrap())
};
fs::write(&out_name, pretty).into_diagnostic()?;
fs::write(out_name, pretty).into_diagnostic()?;
}
Ok(())
}

View File

@@ -84,6 +84,9 @@ impl telemetry::EventListener for Terminal {
telemetry::Event::ParsingProjectFiles => {
println!("{}", "...Parsing project files".bold().purple());
}
telemetry::Event::WaitingForBuildDirLock => {
println!("{}", "...Waiting for build directory lock".bold().purple());
}
telemetry::Event::TypeChecking => {
println!("{}", "...Type-checking project".bold().purple());
}