Skip to content

Commit b4d8034

Browse files
authored
Merge pull request #41 from srishanbhattarai/non-exhaustive-op
Mark Operation enum as non_exhaustive
2 parents d56d013 + 81e4734 commit b4d8034

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
jobs:
22
- template: default.yml@templates
33
parameters:
4-
minrust: 1.36.0
4+
minrust: 1.40.0
55
codecov_token: $(CODECOV_TOKEN_SECRET)
66

77
resources:

src/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,8 @@ impl<V> fmt::Debug for Predicate<V> {
241241
}
242242

243243
/// A pending map operation.
244-
///
245-
/// Note that this enum should be considered
246-
/// [non-exhaustive](https://github.com/rust-lang/rust/issues/44109).
244+
#[non_exhaustive]
247245
#[derive(PartialEq, Eq, Debug)]
248-
// TODO: #[non_exhaustive]
249-
// https://github.com/rust-lang/rust/issues/44109
250246
pub enum Operation<K, V> {
251247
/// Replace the set of entries for this key with this value.
252248
Replace(K, V),
@@ -278,11 +274,6 @@ pub enum Operation<K, V> {
278274
///
279275
/// This can improve performance by pre-allocating space for large value-sets.
280276
Reserve(K, usize),
281-
// Since we have a feature that adds an enum variant, features are only additive (as they need
282-
// to be) if users never try to exhaustively match on this enum. Once rust-lang/rust#44109
283-
// lands, we'll have a more standard way to do this, but for now we rely on this trick:
284-
#[doc(hidden)]
285-
__Nonexhaustive,
286277
}
287278

288279
mod write;

src/write.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,6 @@ where
640640
entry.insert(Values::with_capacity(additional));
641641
}
642642
},
643-
Operation::__Nonexhaustive => unreachable!(),
644643
}
645644
}
646645

@@ -718,7 +717,6 @@ where
718717
entry.insert(Values::with_capacity(additional));
719718
}
720719
},
721-
Operation::__Nonexhaustive => unreachable!(),
722720
}
723721
}
724722
}

0 commit comments

Comments
 (0)