Skip to content

Commit

Permalink
Merge pull request #886 from epage/gix
Browse files Browse the repository at this point in the history
fix: Correctly activate debug assertions
  • Loading branch information
epage committed Feb 11, 2024
2 parents f9eed30 + 67e110a commit 8a97552
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/bin/set-version/errors.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
3 changes: 0 additions & 3 deletions tests/cargo-upgrade/invalid_manifest/stderr.log
Original file line number Diff line number Diff line change
@@ -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
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
...

0 comments on commit 8a97552

Please sign in to comment.