Skip to content

Commit

Permalink
reduce references on match patterns (clippy::match_ref_pats)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Mar 7, 2020
1 parent 3f87f8c commit 8351138
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/libstd/sys_common/process.rs
Expand Up @@ -47,7 +47,7 @@ impl CommandEnv {
}
}
for (key, maybe_val) in self.vars.iter() {
if let &Some(ref val) = maybe_val {
if let Some(ref val) = maybe_val {
env::set_var(key, val);
} else {
env::remove_var(key);
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/sys_common/wtf8.rs
Expand Up @@ -603,8 +603,8 @@ impl Wtf8 {
if len < 3 {
return None;
}
match &self.bytes[(len - 3)..] {
&[0xED, b2 @ 0xA0..=0xAF, b3] => Some(decode_surrogate(b2, b3)),
match self.bytes[(len - 3)..] {
[0xED, b2 @ 0xA0..=0xAF, b3] => Some(decode_surrogate(b2, b3)),
_ => None,
}
}
Expand All @@ -615,8 +615,8 @@ impl Wtf8 {
if len < 3 {
return None;
}
match &self.bytes[..3] {
&[0xED, b2 @ 0xB0..=0xBF, b3] => Some(decode_surrogate(b2, b3)),
match self.bytes[..3] {
[0xED, b2 @ 0xB0..=0xBF, b3] => Some(decode_surrogate(b2, b3)),
_ => None,
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/libtest/types.rs
Expand Up @@ -59,10 +59,10 @@ impl TestName {
}

pub fn with_padding(&self, padding: NamePadding) -> TestName {
let name = match self {
&TestName::StaticTestName(name) => Cow::Borrowed(name),
&TestName::DynTestName(ref name) => Cow::Owned(name.clone()),
&TestName::AlignedTestName(ref name, _) => name.clone(),
let name = match *self {
TestName::StaticTestName(name) => Cow::Borrowed(name),
TestName::DynTestName(ref name) => Cow::Owned(name.clone()),
TestName::AlignedTestName(ref name, _) => name.clone(),
};

TestName::AlignedTestName(name, padding)
Expand Down

0 comments on commit 8351138

Please sign in to comment.