Skip to content

Commit

Permalink
Fix clippy warnings (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 committed Dec 3, 2022
1 parent 36e7b33 commit b0344e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ impl std::fmt::Display for Error {
use self::Error::*;
match self {
ParseOpts(ref e) => e.fmt(f),
ExtraArgs(ref a) => write!(f, "Unexpected arguments {:?}", a),
Cmdline(ref m) => write!(f, "{}", m),
ExtraArgs(ref a) => write!(f, "Unexpected arguments {a:?}"),
Cmdline(ref m) => write!(f, "{m}"),
Decode(ref e) => e.fmt(f),
Builder(ref e) => e.fmt(f),
IO(ref p, ref e) => write!(f, "{}: {}", p, e),
Read(ref e) => write!(f, "Read error: {}", e),
Write(ref e) => write!(f, "Write error: {}", e),
IO(ref p, ref e) => write!(f, "{p}: {e}"),
Read(ref e) => write!(f, "Read error: {e}"),
Write(ref e) => write!(f, "Write error: {e}"),
}
}
}
Expand Down Expand Up @@ -155,7 +155,7 @@ fn main() {
let program = program.rsplit('/').next().unwrap_or(&program);

if let Err(e) = wrapped_main(program, args) {
let _ = writeln!(&mut std::io::stderr(), "{}: {}", program, e);
let _ = writeln!(&mut std::io::stderr(), "{program}: {e}");
std::process::exit(1)
}
}
Expand All @@ -180,8 +180,7 @@ fn wrapped_main(program: &str, args: Vec<String>) -> Result<()> {
if args.len() == 1 && (args[0] == "--help" || args[0] == "-h") {
let brief = format!(
r"Usage: {program} --mode=<mode> --base=<base> [<options>]
Usage: {program} --mode=<mode> --symbols=<symbols> [<options>]",
program = program
Usage: {program} --mode=<mode> --symbols=<symbols> [<options>]"
);
print!(
"{0}
Expand Down
2 changes: 1 addition & 1 deletion nostd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl core::fmt::Write for Fd {
#[panic_handler]
fn panic_handler(info: &core::panic::PanicInfo) -> ! {
unsafe {
let _ = writeln!(Fd(2), "{}", info);
let _ = writeln!(Fd(2), "{info}");
libc::exit(1);
}
}
Expand Down

0 comments on commit b0344e8

Please sign in to comment.