Skip to content

Commit f8f095e

Browse files
authored
Merge pull request #386 from epage/edition
chore: Migrate to Edition 2024
2 parents bc756aa + b0bb8d9 commit f8f095e

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ resolver = "2"
44
[workspace.package]
55
repository = "https://github.com/gitext-rs/git-stack.git"
66
license = "MIT OR Apache-2.0"
7-
edition = "2021"
8-
rust-version = "1.74" # MSRV
7+
edition = "2024"
8+
rust-version = "1.85" # MSRV
99
include = [
1010
"build.rs",
1111
"src/**/*",

src/git/repo.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,8 @@ impl GitRepo {
368368
)?;
369369

370370
if let Some(op) = rebase.next() {
371-
op.map_err(|e| {
371+
op.inspect_err(|_e| {
372372
let _ = rebase.abort();
373-
e
374373
})?;
375374
let inmemory_index = rebase
376375
.inmemory_index()
@@ -383,9 +382,8 @@ impl GitRepo {
383382
.repo
384383
.signature()
385384
.unwrap_or_else(|e| panic!("Unexpected git2 error: {e}"));
386-
let result = rebase.commit(None, &sig, None).map_err(|e| {
385+
let result = rebase.commit(None, &sig, None).inspect_err(|_e| {
387386
let _ = rebase.abort();
388-
e
389387
});
390388
match result {
391389
// Created commit, must be unique

src/graph/ops.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,11 @@ fn mark_push_status(graph: &mut Graph, branch_id: git2::Oid) -> Option<PushStatu
422422
break;
423423
}
424424
Some(PushStatus::Pushed) | Some(PushStatus::Pushable) => {
425-
log::debug!("Branches at {} aren't pushable, parent branch at {} should be pushed first", branch_id, parent_id);
425+
log::debug!(
426+
"Branches at {} aren't pushable, parent branch at {} should be pushed first",
427+
branch_id,
428+
parent_id
429+
);
426430
status = Some(PushStatus::Blocked("parent branch"));
427431
break;
428432
}

src/legacy/git/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Script {
3434

3535
pub fn is_branch_deleted(&self, branch: &str) -> bool {
3636
for command in &self.commands {
37-
if let Command::DeleteBranch(ref current) = command {
37+
if let Command::DeleteBranch(current) = command {
3838
if branch == current {
3939
return true;
4040
}

src/legacy/git/repo.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,8 @@ impl GitRepo {
395395
)?;
396396

397397
if let Some(op) = rebase.next() {
398-
op.map_err(|e| {
398+
op.inspect_err(|_e| {
399399
let _ = rebase.abort();
400-
e
401400
})?;
402401
let inmemory_index = rebase
403402
.inmemory_index()
@@ -410,9 +409,8 @@ impl GitRepo {
410409
.repo
411410
.signature()
412411
.unwrap_or_else(|e| panic!("Unexpected git2 error: {e}"));
413-
let result = rebase.commit(None, &sig, None).map_err(|e| {
412+
let result = rebase.commit(None, &sig, None).inspect_err(|_e| {
414413
let _ = rebase.abort();
415-
e
416414
});
417415
match result {
418416
// Created commit, must be unique

src/legacy/graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ pub use actions::*;
66
pub use node::*;
77
pub use ops::*;
88

9-
use std::collections::btree_map::Entry;
109
use std::collections::BTreeMap;
1110
use std::collections::VecDeque;
11+
use std::collections::btree_map::Entry;
1212

1313
#[derive(Clone, Debug)]
1414
pub struct Graph {

0 commit comments

Comments
 (0)