Skip to content

Commit

Permalink
use pattern in Froms
Browse files Browse the repository at this point in the history
  • Loading branch information
dead10ck committed Feb 22, 2022
1 parent 7ad446d commit 6c335f9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions helix-core/src/auto_pairs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,16 @@ impl Pair {
}

impl From<&(char, char)> for Pair {
fn from(pair: &(char, char)) -> Self {
Self {
open: pair.0,
close: pair.1,
}
fn from(&(open, close): &(char, char)) -> Self {
Self { open, close }
}
}

impl From<(&char, &char)> for Pair {
fn from(pair: (&char, &char)) -> Self {
fn from((open, close): (&char, &char)) -> Self {
Self {
open: *pair.0,
close: *pair.1,
open: *open,
close: *close,
}
}
}
Expand Down

0 comments on commit 6c335f9

Please sign in to comment.