diff --git a/Cargo.toml b/Cargo.toml index 5dba7bd2..6d9447c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,8 @@ resolver = "2" [workspace.package] repository = "https://github.com/gitext-rs/git-stack.git" license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.74" # MSRV +edition = "2024" +rust-version = "1.85" # MSRV include = [ "build.rs", "src/**/*", 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/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/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 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 {