Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump MSRV to 1.78 #169

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.78.0
with:
targets: ${{ matrix.target }}
- name: Install linker
Expand All @@ -70,7 +70,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.78.0
with:
components: rustfmt, clippy
- name: Lint check
Expand All @@ -83,6 +83,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.78.0
- name: Lockfile check
run: cargo update -w --locked --manifest-path cargo-workspaces/Cargo.toml
2 changes: 1 addition & 1 deletion cargo-workspaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/pksunkara/cargo-workspaces"
license = "MIT"
readme = "README.md"
exclude = ["tests"]
rust-version = "1.70.0"
rust-version = "1.78"
default-run = "cargo-workspaces"

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion cargo-workspaces/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl Exec {
.parent()
.ok_or_else(|| Error::ManifestHasNoParent(pkg.name.clone()))?;

let status = Command::new(self.args.get(0).expect(INTERNAL_ERR))
let status = Command::new(self.args.first().expect(INTERNAL_ERR))
.args(&self.args[1..])
.current_dir(dir)
.status()?;
Expand Down
2 changes: 1 addition & 1 deletion cargo-workspaces/src/utils/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn package_registry<'a>(
pkg: &Package,
) -> Result<IndexUrl<'a>> {
let url = if let Some(registry) =
registry.or_else(|| pkg.publish.as_deref().and_then(|x| x.get(0)))
registry.or_else(|| pkg.publish.as_deref().and_then(|x| x.first()))
{
let registry_url = cargo_config_get(
&metadata.workspace_root,
Expand Down
12 changes: 6 additions & 6 deletions cargo-workspaces/src/utils/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ impl VersionOpt {
let new_versions = self.confirm_versions(new_versions)?;

for p in &metadata.packages {
if new_versions.get(&p.name).is_none()
if new_versions.contains_key(&p.name)
&& p.dependencies
.iter()
.all(|x| new_versions.get(&x.name).is_none())
.all(|x| new_versions.contains_key(&x.name))
{
continue;
}
Expand Down Expand Up @@ -345,7 +345,7 @@ impl VersionOpt {
}

fn inc_pre(pre: &[Identifier], preid: &Option<String>) -> Vec<Identifier> {
match pre.get(0) {
match pre.first() {
Some(Identifier::AlphaNumeric(id)) => {
vec![Identifier::AlphaNumeric(id.clone()), Identifier::Numeric(0)]
}
Expand All @@ -368,7 +368,7 @@ fn inc_preid(cur_version: &Version, preid: Identifier) -> Version {
version.increment_patch();
version.pre = vec![preid, Identifier::Numeric(0)];
} else {
match cur_version.pre.get(0).expect(INTERNAL_ERR) {
match cur_version.pre.first().expect(INTERNAL_ERR) {
Identifier::AlphaNumeric(id) => {
version.pre = vec![preid.clone()];

Expand All @@ -385,7 +385,7 @@ fn inc_preid(cur_version: &Version, preid: Identifier) -> Version {
}
Identifier::Numeric(n) => {
if preid.to_string() == n.to_string() {
version.pre = cur_version.pre.clone();
version.pre.clone_from(&cur_version.pre);

if let Some(Identifier::Numeric(n)) = version
.pre
Expand All @@ -405,7 +405,7 @@ fn inc_preid(cur_version: &Version, preid: Identifier) -> Version {
}

fn custom_pre(cur_version: &Version) -> (Identifier, Version) {
let id = if let Some(id) = cur_version.pre.get(0) {
let id = if let Some(id) = cur_version.pre.first() {
id.clone()
} else {
Identifier::AlphaNumeric("alpha".to_string())
Expand Down
2 changes: 0 additions & 2 deletions cargo-workspaces/tests/snapshots/create__create_bin_2015.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ name = "mynewcrate-bin-2015"
version = "0.0.0"
edition = "2015"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
2 changes: 0 additions & 2 deletions cargo-workspaces/tests/snapshots/create__create_bin_2018.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ name = "mynewcrate-bin-2018"
version = "0.0.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
2 changes: 0 additions & 2 deletions cargo-workspaces/tests/snapshots/create__create_lib_2015.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ name = "mynewcrate-lib-2015"
version = "0.0.0"
edition = "2015"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
2 changes: 0 additions & 2 deletions cargo-workspaces/tests/snapshots/create__create_lib_2018.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ name = "mynewcrate-lib-2018"
version = "0.0.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
2 changes: 0 additions & 2 deletions cargo-workspaces/tests/snapshots/create__member_glob.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ name = "dep3"
version = "0.0.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]