Skip to content

Commit 8c367b4

Browse files
newAMeldruin
authored andcommitted
treewide: fix clippy::use_self
This is a non-default nursery lint.
1 parent e98edca commit 8c367b4

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

src/fnv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct Hasher {
1414

1515
impl Default for Hasher {
1616
fn default() -> Self {
17-
Hasher { state: BASIS }
17+
Self { state: BASIS }
1818
}
1919
}
2020

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
4949
#![deny(missing_docs)]
5050
#![deny(warnings)]
51+
#![warn(clippy::use_self)]
5152
#![no_std]
5253

5354
use core::fmt;
@@ -72,20 +73,20 @@ pub struct BuildHasherDefault<H> {
7273

7374
impl<H> Default for BuildHasherDefault<H> {
7475
fn default() -> Self {
75-
BuildHasherDefault {
76+
Self {
7677
_marker: PhantomData,
7778
}
7879
}
7980
}
8081

8182
impl<H> Clone for BuildHasherDefault<H> {
8283
fn clone(&self) -> Self {
83-
BuildHasherDefault::default()
84+
Self::default()
8485
}
8586
}
8687

8788
impl<H> PartialEq for BuildHasherDefault<H> {
88-
fn eq(&self, _other: &BuildHasherDefault<H>) -> bool {
89+
fn eq(&self, _other: &Self) -> bool {
8990
true
9091
}
9192
}
@@ -101,7 +102,7 @@ impl<H> fmt::Debug for BuildHasherDefault<H> {
101102
impl<H> BuildHasherDefault<H> {
102103
/// `const` constructor
103104
pub const fn new() -> Self {
104-
BuildHasherDefault {
105+
Self {
105106
_marker: PhantomData,
106107
}
107108
}

src/murmur3.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ enum Index {
3030
impl Index {
3131
fn usize(&self) -> usize {
3232
match *self {
33-
Index::_0 => 0,
34-
Index::_1 => 1,
35-
Index::_2 => 2,
36-
Index::_3 => 3,
33+
Self::_0 => 0,
34+
Self::_1 => 1,
35+
Self::_2 => 2,
36+
Self::_3 => 3,
3737
}
3838
}
3939
}
4040

4141
impl From<usize> for Index {
4242
fn from(x: usize) -> Self {
4343
match x % 4 {
44-
0 => Index::_0,
45-
1 => Index::_1,
46-
2 => Index::_2,
47-
3 => Index::_3,
44+
0 => Self::_0,
45+
1 => Self::_1,
46+
2 => Self::_2,
47+
3 => Self::_3,
4848
_ => unreachable!(),
4949
}
5050
}
@@ -75,7 +75,7 @@ impl Hasher {
7575
impl Default for Hasher {
7676
#[allow(deprecated)]
7777
fn default() -> Self {
78-
Hasher {
78+
Self {
7979
buf: Buffer {
8080
bytes: MaybeUninit::uninit(),
8181
},

0 commit comments

Comments
 (0)