Fixed a spelling and some clippy warnings

This commit is contained in:
Hanif Bin Ariffin 2020-08-19 18:20:51 -04:00
parent 51b66125ba
commit 47428433d4
3 changed files with 5 additions and 5 deletions

View File

@ -120,7 +120,7 @@ fn extract_man(subcommand: &str, extension: &str) -> Option<Vec<u8>> {
fn write_and_spawn(contents: &[u8], command: &str) -> CargoResult<()> {
let mut tmp = tempfile::Builder::new().prefix("cargo-man").tempfile()?;
let f = tmp.as_file_mut();
f.write_all(&contents)?;
f.write_all(contents)?;
f.flush()?;
let mut cmd = std::process::Command::new(command)
.arg(tmp.path())

View File

@ -72,14 +72,14 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
ops::run(&ws, &compile_opts, &values_os(args, "args")).map_err(|err| {
let proc_err = match err.downcast_ref::<ProcessError>() {
Some(e) => e,
None => return CliError::new(err.into(), 101),
None => return CliError::new(err, 101),
};
// If we never actually spawned the process then that sounds pretty
// bad and we always want to forward that up.
let exit = match proc_err.exit {
Some(exit) => exit,
None => return CliError::new(err.into(), 101),
None => return CliError::new(err, 101),
};
// If `-q` was passed then we suppress extra error information about
@ -90,7 +90,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
if is_quiet {
CliError::code(exit_code)
} else {
CliError::new(err.into(), exit_code)
CliError::new(err, exit_code)
}
})
}

View File

@ -93,7 +93,7 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
)?;
verify_dependencies(pkg, &registry, reg_id)?;
// Prepare a tarball, with a non-surpressable warning if metadata
// Prepare a tarball, with a non-suppressible warning if metadata
// is missing since this is being put online.
let tarball = ops::package(
ws,