Skip to content

Commit 71e5449

Browse files
committed
style: Make clippy happy
1 parent 3fed5ee commit 71e5449

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

crates/git-branch-stash/src/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl RepoConfig {
1717
let default_config = match git2::Config::open_default() {
1818
Ok(config) => Some(config),
1919
Err(err) => {
20-
log::debug!("Failed to load git config: {}", err);
20+
log::debug!("Failed to load git config: {err}");
2121
None
2222
}
2323
};
@@ -40,7 +40,7 @@ impl RepoConfig {
4040
match git2::Config::open(&config_path) {
4141
Ok(config) => Ok(Self::from_gitconfig(&config)),
4242
Err(err) => {
43-
log::debug!("Failed to load git config: {}", err);
43+
log::debug!("Failed to load git config: {err}");
4444
Ok(Default::default())
4545
}
4646
}
@@ -59,7 +59,7 @@ impl RepoConfig {
5959
match git2::Config::open(&config_path) {
6060
Ok(config) => Ok(Self::from_gitconfig(&config)),
6161
Err(err) => {
62-
log::debug!("Failed to load git config: {}", err);
62+
log::debug!("Failed to load git config: {err}");
6363
Ok(Default::default())
6464
}
6565
}
@@ -88,7 +88,7 @@ impl RepoConfig {
8888
let mut config = Self::default();
8989

9090
for (key, value) in iter {
91-
log::trace!("Env config: {}={:?}", key, value);
91+
log::trace!("Env config: {key}={value:?}");
9292
if key == PROTECTED_STACK_FIELD {
9393
if let Some(value) = value {
9494
config
@@ -115,7 +115,7 @@ impl RepoConfig {
115115
let config = match git2::Config::open_default() {
116116
Ok(config) => Some(config),
117117
Err(err) => {
118-
log::debug!("Failed to load git config: {}", err);
118+
log::debug!("Failed to load git config: {err}");
119119
None
120120
}
121121
};

crates/git-branch-stash/src/snapshot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ impl Snapshot {
7676

7777
for (_old_id, new_id, name) in &planned_changes {
7878
if head_branch_name == Some(name) {
79-
log::debug!("Restoring {} (HEAD)", name);
79+
log::debug!("Restoring {name} (HEAD)");
8080
repo.detach()?;
8181
repo.branch(name, *new_id)?;
8282
repo.switch(name)?;
8383
} else {
84-
log::debug!("Restoring {}", name);
84+
log::debug!("Restoring {name}");
8585
repo.branch(name, *new_id)?;
8686
}
8787
}

crates/git-branch-stash/src/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl Stack {
104104
let len = elems.len();
105105
if capacity < len {
106106
let remove = len - capacity;
107-
log::debug!("Too many snapshots, clearing {} oldest", remove);
107+
log::debug!("Too many snapshots, clearing {remove} oldest");
108108
for snapshot_path in &elems[0..remove] {
109109
if let Err(err) = std::fs::remove_file(snapshot_path) {
110110
log::debug!("Failed to remove {}: {}", snapshot_path.display(), err);

src/main.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,11 @@ fn stash_push(repo: &mut git_branch_stash::GitRepo, context: &str) -> Option<git
271271

272272
match stash_id {
273273
Ok(stash_id) => {
274-
log::info!(
275-
"Saved working directory and index state {}: {}",
276-
stash_msg,
277-
stash_id
278-
);
274+
log::info!("Saved working directory and index state {stash_msg}: {stash_id}");
279275
Some(stash_id)
280276
}
281277
Err(err) => {
282-
log::debug!("Failed to stash: {}", err);
278+
log::debug!("Failed to stash: {err}");
283279
None
284280
}
285281
}
@@ -304,10 +300,10 @@ fn stash_pop(repo: &mut git_branch_stash::GitRepo, stash_id: Option<git2::Oid>)
304300

305301
match repo.raw_mut().stash_pop(index, None) {
306302
Ok(()) => {
307-
log::info!("Dropped refs/stash {}", stash_id);
303+
log::info!("Dropped refs/stash {stash_id}");
308304
}
309305
Err(err) => {
310-
log::error!("Failed to pop {} from stash: {}", stash_id, err);
306+
log::error!("Failed to pop {stash_id} from stash: {err}");
311307
}
312308
}
313309
}

0 commit comments

Comments
 (0)