diff --git a/cargo-smart-release/Cargo.lock b/cargo-smart-release/Cargo.lock index d327b537771..4c1d9a57741 100644 --- a/cargo-smart-release/Cargo.lock +++ b/cargo-smart-release/Cargo.lock @@ -189,9 +189,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.15.4" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", @@ -309,9 +309,9 @@ dependencies = [ [[package]] name = "crates-index" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3feb29cc02fb72a5999ea88eaf38e82fb9ef453a746925d3bf74ebc25940c34c" +checksum = "a2d899e96f67edf44af465951d34f354c7bc04d10a42b813537cd70d62dfbb50" dependencies = [ "gix", "hex", diff --git a/cargo-smart-release/Cargo.toml b/cargo-smart-release/Cargo.toml index c64d3a9e623..1b1952c06a0 100644 --- a/cargo-smart-release/Cargo.toml +++ b/cargo-smart-release/Cargo.toml @@ -28,11 +28,11 @@ gix = { version = "^0.50.0", default-features = false, features = ["max-performa anyhow = "1.0.42" clap = { version = "4.1.0", features = ["derive", "cargo"] } env_logger = { version = "0.10.0", default-features = false, features = ["humantime", "auto-color"] } -cargo_metadata = "0.15.0" +cargo_metadata = "0.17.0" log = "0.4.14" toml_edit = "0.19.1" semver = "1.0.4" -crates-index = { version = "2.0.0", default-features = false, features = ["git-performance", "git-https"] } +crates-index = { version = "2.1.0", default-features = false, features = ["git-performance", "git-https"] } cargo_toml = "0.15.1" winnow = "0.5.1" git-conventional = "0.12.0" diff --git a/cargo-smart-release/src/crates_index.rs b/cargo-smart-release/src/crates_index.rs index 45884f4c3a1..7695ae12a32 100644 --- a/cargo-smart-release/src/crates_index.rs +++ b/cargo-smart-release/src/crates_index.rs @@ -1,5 +1,3 @@ -use std::path::PathBuf; - pub struct Index { inner: Option, } @@ -7,13 +5,8 @@ pub struct Index { impl Index { /// Like the original one, but doesn't create it if it doesn't exist pub fn new_cargo_default() -> Result { - let path = default_path(); Ok(Index { - inner: if path.is_dir() { - crates_index::GitIndex::new_cargo_default()?.into() - } else { - None - }, + inner: crates_index::GitIndex::try_new_cargo_default()?, }) } @@ -29,9 +22,3 @@ impl Index { self.inner.as_ref().and_then(|idx| idx.crate_(name)) } } - -fn default_path() -> PathBuf { - crates_index::local_path_and_canonical_url(crates_index::git::URL, None) - .expect("defaults are well-known") - .0 -}