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:
parent
6d2a99e1ae
commit
4d7b942b75
|
|
@ -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)),
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue