diff --git a/src/bin/set-version/errors.rs b/src/bin/set-version/errors.rs index b29537742c..15bca470e3 100644 --- a/src/bin/set-version/errors.rs +++ b/src/bin/set-version/errors.rs @@ -1,8 +1,7 @@ use std::fmt::Display; pub use cargo_edit::CargoResult; -pub use cargo_edit::CliResult; -pub use cargo_edit::Context; + pub use cargo_edit::Error; /// User requested to downgrade a crate diff --git a/src/manifest.rs b/src/manifest.rs index 664db511b1..0dab347cfe 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -141,7 +141,7 @@ impl Manifest { path: &[String], insert_if_not_exists: bool, ) -> CargoResult<&'a mut toml_edit::Item> { - if let Some(segment) = path.get(0) { + if let Some(segment) = path.first() { let value = if insert_if_not_exists { input[&segment].or_insert(toml_edit::table()) } else { diff --git a/src/version.rs b/src/version.rs index b42f6952bb..5466672544 100644 --- a/src/version.rs +++ b/src/version.rs @@ -162,7 +162,7 @@ pub fn upgrade_requirement(req: &str, version: &semver::Version) -> CargoResult< new_req_text.remove(0); } // Validate contract - #[cfg(debug_assert)] + #[cfg(debug_assertions)] { assert!( new_req.matches(version), diff --git a/tests/cargo-upgrade/invalid_manifest/stderr.log b/tests/cargo-upgrade/invalid_manifest/stderr.log index 2520158a9c..66720d2658 100644 --- a/tests/cargo-upgrade/invalid_manifest/stderr.log +++ b/tests/cargo-upgrade/invalid_manifest/stderr.log @@ -1,9 +1,6 @@ Updating '[ROOTURL]/registry' index Error: `cargo metadata` exited with an error: error: failed to parse manifest at `[ROOT]/case/Cargo.toml` -Caused by: - could not parse input as TOML - Caused by: TOML parse error at line 1, column 6 | diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log b/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log index ff297b6e2b..db8df135ad 100644 --- a/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log +++ b/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log @@ -2,5 +2,5 @@ Error: `cargo metadata` exited with an error: error: failed to parse manifest at `[ROOT]/case/Cargo.toml` Caused by: - could not parse input as TOML + TOML parse error at line 1, column 6 ...