remote-helper: Rename `to_branch_name`

Since `to_branch_name` consumes `self`, it should better be called
`into_branch_name`.

See also
<https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention>.
This commit is contained in:
Lorenz Leutgeb 2026-02-17 23:24:27 +01:00
parent 6d2a99e1ae
commit 4d7b942b75
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -176,7 +176,7 @@ enum Branch {
impl Branch {
/// Return the branch name to be used for the local branch when creating a
/// patch.
fn to_branch_name(self, object: &radicle::patch::PatchId) -> Option<git::fmt::Qualified<'_>> {
fn into_branch_name(self, object: &radicle::patch::PatchId) -> Option<git::fmt::Qualified<'_>> {
match self {
Self::None => None,
Self::MirrorUpstream => Some(git::refs::patch(object)),

View File

@ -637,7 +637,7 @@ where
)?;
if let Some(upstream) = upstream {
if let Some(local_branch) = opts.branch.to_branch_name(&patch) {
if let Some(local_branch) = opts.branch.into_branch_name(&patch) {
fn strip_refs_heads(qualified: git::fmt::Qualified) -> git::fmt::RefString {
let (_refs, _heads, x, xs) = qualified.non_empty_components();
std::iter::once(x).chain(xs).collect()