File tree Expand file tree Collapse file tree 3 files changed +15
-14
lines changed Expand file tree Collapse file tree 3 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ pub struct Hasher {
14
14
15
15
impl Default for Hasher {
16
16
fn default ( ) -> Self {
17
- Hasher { state : BASIS }
17
+ Self { state : BASIS }
18
18
}
19
19
}
20
20
Original file line number Diff line number Diff line change 48
48
49
49
#![ deny( missing_docs) ]
50
50
#![ deny( warnings) ]
51
+ #![ warn( clippy:: use_self) ]
51
52
#![ no_std]
52
53
53
54
use core:: fmt;
@@ -72,20 +73,20 @@ pub struct BuildHasherDefault<H> {
72
73
73
74
impl < H > Default for BuildHasherDefault < H > {
74
75
fn default ( ) -> Self {
75
- BuildHasherDefault {
76
+ Self {
76
77
_marker : PhantomData ,
77
78
}
78
79
}
79
80
}
80
81
81
82
impl < H > Clone for BuildHasherDefault < H > {
82
83
fn clone ( & self ) -> Self {
83
- BuildHasherDefault :: default ( )
84
+ Self :: default ( )
84
85
}
85
86
}
86
87
87
88
impl < H > PartialEq for BuildHasherDefault < H > {
88
- fn eq ( & self , _other : & BuildHasherDefault < H > ) -> bool {
89
+ fn eq ( & self , _other : & Self ) -> bool {
89
90
true
90
91
}
91
92
}
@@ -101,7 +102,7 @@ impl<H> fmt::Debug for BuildHasherDefault<H> {
101
102
impl < H > BuildHasherDefault < H > {
102
103
/// `const` constructor
103
104
pub const fn new ( ) -> Self {
104
- BuildHasherDefault {
105
+ Self {
105
106
_marker : PhantomData ,
106
107
}
107
108
}
Original file line number Diff line number Diff line change @@ -30,21 +30,21 @@ enum Index {
30
30
impl Index {
31
31
fn usize ( & self ) -> usize {
32
32
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 ,
37
37
}
38
38
}
39
39
}
40
40
41
41
impl From < usize > for Index {
42
42
fn from ( x : usize ) -> Self {
43
43
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,
48
48
_ => unreachable ! ( ) ,
49
49
}
50
50
}
@@ -75,7 +75,7 @@ impl Hasher {
75
75
impl Default for Hasher {
76
76
#[ allow( deprecated) ]
77
77
fn default ( ) -> Self {
78
- Hasher {
78
+ Self {
79
79
buf : Buffer {
80
80
bytes : MaybeUninit :: uninit ( ) ,
81
81
} ,
You can’t perform that action at this time.
0 commit comments