Skip to content

Commit c01764b

Browse files
committed
Use Self for recursive enums
1 parent 50e8cdc commit c01764b

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
@@ -225,7 +225,7 @@ enum PatState<'a> {
225225
/// A std enum we know won't be extended. Tracks the states of each variant separately.
226226
///
227227
/// This is not used for `Option` since it uses the current pattern to track it's state.
228-
StdEnum(&'a mut [PatState<'a>]),
228+
StdEnum(&'a mut [Self]),
229229
/// Either the initial state for a pattern or a non-std enum. There is currently no need to
230230
/// distinguish these cases.
231231
///

clippy_utils/src/consts.rs

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

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)