Skip to content

Commit 0cdf461

Browse files
committed
thanks clippy
1 parent 85830b7 commit 0cdf461

File tree

7 files changed

+13
-35
lines changed

7 files changed

+13
-35
lines changed

crates/but-graph/src/init/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,7 @@ impl Graph {
357357
let target = ws_meta.target_ref.as_ref().and_then(|trn| {
358358
let tid = try_refname_to_id(repo, trn.as_ref())
359359
.map_err(|err| {
360-
tracing::warn!(
361-
"Ignoring non-existing target branch {trn}: {err}",
362-
trn = trn.as_bstr()
363-
);
360+
tracing::warn!("Ignoring non-existing target branch {trn}: {err}");
364361
err
365362
})
366363
.ok()??;

crates/but-graph/src/init/walk.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -624,15 +624,13 @@ pub fn obtain_workspace_infos<T: RefMetadata>(
624624
for (rn, data) in workspaces {
625625
if rn.category() != Some(Category::LocalBranch) {
626626
tracing::warn!(
627-
"Skipped workspace at ref {} as workspaces can only ever be on normal branches",
628-
rn.as_bstr()
627+
"Skipped workspace at ref {rn} as workspaces can only ever be on normal branches",
629628
);
630629
continue;
631630
}
632631
if target_refs.contains(&rn) {
633632
tracing::warn!(
634-
"Skipped workspace at ref {} as it was also a target ref for another workspace (or for itself)",
635-
rn.as_bstr()
633+
"Skipped workspace at ref {rn} as it was also a target ref for another workspace (or for itself)",
636634
);
637635
continue;
638636
}
@@ -642,16 +640,13 @@ pub fn obtain_workspace_infos<T: RefMetadata>(
642640
.filter(|trn| trn.category() != Some(Category::RemoteBranch))
643641
{
644642
tracing::warn!(
645-
"Skipped workspace at ref {} as its target reference {target} was not a remote tracking branch",
646-
rn.as_bstr(),
647-
target = invalid_target_ref.as_bstr(),
643+
"Skipped workspace at ref {rn} as its target reference {invalid_target_ref} was not a remote tracking branch",
648644
);
649645
continue;
650646
}
651647
let Some(ws_tip) = try_refname_to_id(repo, rn.as_ref())? else {
652648
tracing::warn!(
653-
"Ignoring stale workspace ref '{ws_ref}', which didn't exist in Git but still had workspace data",
654-
ws_ref = rn.as_bstr()
649+
"Ignoring stale workspace ref '{rn}', which didn't exist in Git but still had workspace data",
655650
);
656651
continue;
657652
};

crates/but-graph/src/projection/workspace.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,8 +1060,7 @@ impl Workspace<'_> {
10601060
}
10611061
if !found_segment {
10621062
tracing::error!(
1063-
"BUG: Couldn't find local segment with remote tracking ref '{rn}' - remote commits for it seem to be missing",
1064-
rn = remote_tracking_ref_name.as_bstr()
1063+
"BUG: Couldn't find local segment with remote tracking ref '{remote_tracking_ref_name}' - remote commits for it seem to be missing",
10651064
);
10661065
}
10671066
}

crates/but-workspace/src/branch/checkout/utils.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,7 @@ impl std::fmt::Debug for Outcome {
208208
Some(edits) => edits
209209
.last()
210210
.map(|edit| {
211-
format!(
212-
"Update {} to {:?}",
213-
edit.name.as_bstr(),
214-
edit.change.new_value()
215-
)
211+
format!("Update {} to {:?}", edit.name, edit.change.new_value())
216212
})
217213
.unwrap_or_default(),
218214
},

crates/but-workspace/src/branch_details.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn branch_details_v3(
168168
.last()
169169
.map(|id| id.detach())
170170
.unwrap_or_else(|| {
171-
tracing::warn!("No merge-base found between {name} and the integration branch {integration_branch_name}", name = name.as_bstr());
171+
tracing::warn!("No merge-base found between {name} and the integration branch {integration_branch_name}");
172172
// default to the tip just like the code previously did, resulting in no information
173173
// TODO: we should probably indicate that there is no merge-base instead of just glossing over it.
174174
branch_id.detach()

crates/but-workspace/src/ui/ref_info.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,10 @@ impl RemoteTrackingReference {
4646
remote_names: &gix::remote::Names,
4747
) -> anyhow::Result<Self> {
4848
let (category, short_name) = ref_name.category_and_short_name().with_context(|| {
49-
format!(
50-
"Failed to categorize presume remote reference '{}'",
51-
ref_name.as_bstr()
52-
)
49+
format!("Failed to categorize presume remote reference '{ref_name}'")
5350
})?;
5451
if category != Category::RemoteBranch {
55-
bail!(
56-
"Expected '{}' to be a remote tracking branch, but was {category:?}",
57-
ref_name.as_bstr()
58-
);
52+
bail!("Expected '{ref_name}' to be a remote tracking branch, but was {category:?}");
5953
}
6054
let (longest_remote, short_name) = remote_names
6155
.iter()
@@ -76,10 +70,7 @@ impl RemoteTrackingReference {
7670
"Failed to find remote branch's corresponding remote"
7771
))
7872
.with_context(|| {
79-
format!(
80-
"Remote reference '{}' couldn't be matched with any known remote",
81-
ref_name.as_bstr()
82-
)
73+
format!("Remote reference '{ref_name}' couldn't be matched with any known remote")
8374
})?;
8475

8576
Ok(RemoteTrackingReference {

crates/gitbutler-branch-actions/src/branch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ fn branch_group_to_branch(
323323
let head_commit = if let Some(vbranch) = virtual_branch {
324324
Some(vbranch.head_oid(repo)?)
325325
} else if let Some(mut branch) = local_branches.into_iter().next() {
326-
branch.peel_to_id_in_place_packed(packed).ok()
326+
branch.peel_to_id_packed(packed).ok()
327327
} else if let Some(mut branch) = remote_branches.into_iter().next() {
328-
branch.peel_to_id_in_place_packed(packed).ok()
328+
branch.peel_to_id_packed(packed).ok()
329329
} else {
330330
None
331331
}

0 commit comments

Comments
 (0)