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