From a0b2547449a0bb40f9aeaad13bb0ddc3589ef13c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 27 Feb 2025 12:22:25 -0600 Subject: [PATCH 1/3] chore: Updaet MSRV to 1.85 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5dba7bd2..182b3b1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ resolver = "2" repository = "https://github.com/gitext-rs/git-stack.git" license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.74" # MSRV +rust-version = "1.85" # MSRV include = [ "build.rs", "src/**/*", From 23442b28fe25be40a485d75a2c631ac0679b7a89 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 27 Feb 2025 12:24:27 -0600 Subject: [PATCH 2/3] chore: Migrate to Edition 2024 --- Cargo.toml | 2 +- src/graph/ops.rs | 6 +++++- src/legacy/git/commands.rs | 2 +- src/legacy/graph/mod.rs | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 182b3b1a..6d9447c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ resolver = "2" [workspace.package] repository = "https://github.com/gitext-rs/git-stack.git" license = "MIT OR Apache-2.0" -edition = "2021" +edition = "2024" rust-version = "1.85" # MSRV include = [ "build.rs", diff --git a/src/graph/ops.rs b/src/graph/ops.rs index 3b1197a4..a87f7277 100644 --- a/src/graph/ops.rs +++ b/src/graph/ops.rs @@ -422,7 +422,11 @@ fn mark_push_status(graph: &mut Graph, branch_id: git2::Oid) -> Option { - log::debug!("Branches at {} aren't pushable, parent branch at {} should be pushed first", branch_id, parent_id); + log::debug!( + "Branches at {} aren't pushable, parent branch at {} should be pushed first", + branch_id, + parent_id + ); status = Some(PushStatus::Blocked("parent branch")); break; } diff --git a/src/legacy/git/commands.rs b/src/legacy/git/commands.rs index 16139a5e..4368f6c6 100644 --- a/src/legacy/git/commands.rs +++ b/src/legacy/git/commands.rs @@ -34,7 +34,7 @@ impl Script { pub fn is_branch_deleted(&self, branch: &str) -> bool { for command in &self.commands { - if let Command::DeleteBranch(ref current) = command { + if let Command::DeleteBranch(current) = command { if branch == current { return true; } diff --git a/src/legacy/graph/mod.rs b/src/legacy/graph/mod.rs index cbeb7113..d81a5862 100644 --- a/src/legacy/graph/mod.rs +++ b/src/legacy/graph/mod.rs @@ -6,9 +6,9 @@ pub use actions::*; pub use node::*; pub use ops::*; -use std::collections::btree_map::Entry; use std::collections::BTreeMap; use std::collections::VecDeque; +use std::collections::btree_map::Entry; #[derive(Clone, Debug)] pub struct Graph { From b0bb8d941bde5e987ce18810cbeb969c11901496 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 27 Feb 2025 12:32:27 -0600 Subject: [PATCH 3/3] style: Make clippy happy --- src/git/repo.rs | 6 ++---- src/legacy/git/repo.rs | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/git/repo.rs b/src/git/repo.rs index 333f4a44..ecfed7ef 100644 --- a/src/git/repo.rs +++ b/src/git/repo.rs @@ -368,9 +368,8 @@ impl GitRepo { )?; if let Some(op) = rebase.next() { - op.map_err(|e| { + op.inspect_err(|_e| { let _ = rebase.abort(); - e })?; let inmemory_index = rebase .inmemory_index() @@ -383,9 +382,8 @@ impl GitRepo { .repo .signature() .unwrap_or_else(|e| panic!("Unexpected git2 error: {e}")); - let result = rebase.commit(None, &sig, None).map_err(|e| { + let result = rebase.commit(None, &sig, None).inspect_err(|_e| { let _ = rebase.abort(); - e }); match result { // Created commit, must be unique diff --git a/src/legacy/git/repo.rs b/src/legacy/git/repo.rs index a187faaa..6c43be23 100644 --- a/src/legacy/git/repo.rs +++ b/src/legacy/git/repo.rs @@ -395,9 +395,8 @@ impl GitRepo { )?; if let Some(op) = rebase.next() { - op.map_err(|e| { + op.inspect_err(|_e| { let _ = rebase.abort(); - e })?; let inmemory_index = rebase .inmemory_index() @@ -410,9 +409,8 @@ impl GitRepo { .repo .signature() .unwrap_or_else(|e| panic!("Unexpected git2 error: {e}")); - let result = rebase.commit(None, &sig, None).map_err(|e| { + let result = rebase.commit(None, &sig, None).inspect_err(|_e| { let _ = rebase.abort(); - e }); match result { // Created commit, must be unique