Skip to content

Commit

Permalink
upgrade smart-release to the latest crates-index
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 2, 2023
1 parent f852243 commit 73ec02b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
8 changes: 4 additions & 4 deletions cargo-smart-release/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cargo-smart-release/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 1 addition & 14 deletions cargo-smart-release/src/crates_index.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
use std::path::PathBuf;

pub struct Index {
inner: Option<crates_index::GitIndex>,
}

impl Index {
/// Like the original one, but doesn't create it if it doesn't exist
pub fn new_cargo_default() -> Result<Index, crates_index::Error> {
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()?,
})
}

Expand All @@ -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
}

0 comments on commit 73ec02b

Please sign in to comment.