Skip to content

Commit 292d7ef

Browse files
committed
Use Self for recursive enums
1 parent 3a0bb7b commit 292d7ef

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

clippy_lints/src/matches/single_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ enum PatState<'a> {
224224
/// A std enum we know won't be extended. Tracks the states of each variant separately.
225225
///
226226
/// This is not used for `Option` since it uses the current pattern to track its state.
227-
StdEnum(&'a mut [PatState<'a>]),
227+
StdEnum(&'a mut [Self]),
228228
/// Either the initial state for a pattern or a non-std enum. There is currently no need to
229229
/// distinguish these cases.
230230
///

clippy_utils/src/consts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ pub enum Constant {
5050
/// `true` or `false`.
5151
Bool(bool),
5252
/// An array of constants.
53-
Vec(Vec<Constant>),
53+
Vec(Vec<Self>),
5454
/// Also an array, but with only one constant, repeated N times.
55-
Repeat(Box<Constant>, u64),
55+
Repeat(Box<Self>, u64),
5656
/// A tuple of constants.
57-
Tuple(Vec<Constant>),
57+
Tuple(Vec<Self>),
5858
/// A raw pointer.
5959
RawPtr(u128),
6060
/// A reference
61-
Ref(Box<Constant>),
61+
Ref(Box<Self>),
6262
/// A literal with syntax error.
6363
Err,
6464
}

clippy_utils/src/sugg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub enum Sugg<'a> {
3333
/// or `-`, but only if the type with and without the operator is kept identical.
3434
/// It means that doubling the operator can be used to remove it instead, in
3535
/// order to provide better suggestions.
36-
UnOp(UnOp, Box<Sugg<'a>>),
36+
UnOp(UnOp, Box<Self>),
3737
}
3838

3939
/// Literal constant `0`, for convenience.

0 commit comments

Comments
 (0)