History

upgrade smart-release to the latest `crates-index`

Sebastian Thiel committed 3 years ago

Commit 73ec02b1 parent f8522433 files · +7 −20Browse files

Unified · Split

3 files
  1. cargo-smart-release/Cargo.lock +4 −4
  2. cargo-smart-release/Cargo.toml +2 −2
  3. cargo-smart-release/src/crates_index.rs +1 −14
cargo-smart-release/Cargo.lock+4−4
@@ -189,9 +189,9 @@ dependencies = [ · 188 unmodified lines
189 189
190[[package]]190[[package]]
191name = "cargo_metadata"191name = "cargo_metadata"
192version = "0.15.4"192version = "0.17.0"
193source = "registry+https://github.com/rust-lang/crates.io-index"193source = "registry+https://github.com/rust-lang/crates.io-index"
194checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a"194checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592"
195dependencies = [195dependencies = [
196 "camino",196 "camino",
197 "cargo-platform",197 "cargo-platform",
@@ -309,9 +309,9 @@ dependencies = [ · 111 unmodified lines
309 309
310[[package]]310[[package]]
311name = "crates-index"311name = "crates-index"
312version = "2.0.0"312version = "2.1.0"
313source = "registry+https://github.com/rust-lang/crates.io-index"313source = "registry+https://github.com/rust-lang/crates.io-index"
314checksum = "3feb29cc02fb72a5999ea88eaf38e82fb9ef453a746925d3bf74ebc25940c34c"314checksum = "a2d899e96f67edf44af465951d34f354c7bc04d10a42b813537cd70d62dfbb50"
315dependencies = [315dependencies = [
316 "gix",316 "gix",
317 "hex",317 "hex",
cargo-smart-release/Cargo.toml+2−2
@@ -28,11 +28,11 @@ gix = { version = "^0.50.0", default-features = false, features = ["max-performa · 27 unmodified lines
28anyhow = "1.0.42"28anyhow = "1.0.42"
29clap = { version = "4.1.0", features = ["derive", "cargo"] }29clap = { version = "4.1.0", features = ["derive", "cargo"] }
30env_logger = { version = "0.10.0", default-features = false, features = ["humantime", "auto-color"] }30env_logger = { version = "0.10.0", default-features = false, features = ["humantime", "auto-color"] }
31cargo_metadata = "0.15.0"31cargo_metadata = "0.17.0"
32log = "0.4.14"32log = "0.4.14"
33toml_edit = "0.19.1"33toml_edit = "0.19.1"
34semver = "1.0.4"34semver = "1.0.4"
35crates-index = { version = "2.0.0", default-features = false, features = ["git-performance", "git-https"] }35crates-index = { version = "2.1.0", default-features = false, features = ["git-performance", "git-https"] }
36cargo_toml = "0.15.1"36cargo_toml = "0.15.1"
37winnow = "0.5.1"37winnow = "0.5.1"
38git-conventional = "0.12.0"38git-conventional = "0.12.0"
cargo-smart-release/src/crates_index.rs+1−14
@@ -1,5 +1,3 @@
1use std::path::PathBuf;
2
3pub struct Index {1pub struct Index {
4 inner: Option<crates_index::GitIndex>,2 inner: Option<crates_index::GitIndex>,
5}3}
@@ -7,13 +5,8 @@ pub struct Index { · 1 unmodified line
7impl Index {5impl Index {
8 /// Like the original one, but doesn't create it if it doesn't exist6 /// Like the original one, but doesn't create it if it doesn't exist
9 pub fn new_cargo_default() -> Result<Index, crates_index::Error> {7 pub fn new_cargo_default() -> Result<Index, crates_index::Error> {
10 let path = default_path();
11 Ok(Index {8 Ok(Index {
12 inner: if path.is_dir() {9 inner: crates_index::GitIndex::try_new_cargo_default()?,
13 crates_index::GitIndex::new_cargo_default()?.into()
14 } else {
15 None
16 },
17 })10 })
18 }11 }
19 12
@@ -29,9 +22,3 @@ impl Index { · 9 unmodified lines
29 self.inner.as_ref().and_then(|idx| idx.crate_(name))22 self.inner.as_ref().and_then(|idx| idx.crate_(name))
30 }23 }
31}24}
32
33fn default_path() -> PathBuf {
34 crates_index::local_path_and_canonical_url(crates_index::git::URL, None)
35 .expect("defaults are well-known")
36 .0
37}