We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1896756 + 3f3087b commit b742d7eCopy full SHA for b742d7e
src/librustc/middle/resolve_lifetime.rs
@@ -170,16 +170,11 @@ pub enum Set1<T> {
170
171
impl<T: PartialEq> Set1<T> {
172
pub fn insert(&mut self, value: T) {
173
- if let Set1::Empty = *self {
174
- *self = Set1::One(value);
175
- return;
176
- }
177
- if let Set1::One(ref old) = *self {
178
- if *old == value {
179
180
181
182
- *self = Set1::Many;
+ *self = match self {
+ Set1::Empty => Set1::One(value),
+ Set1::One(old) if *old == value => return,
+ _ => Set1::Many,
+ };
183
}
184
185
0 commit comments