Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Operation enum as non_exhaustive #41

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
jobs:
- template: default.yml@templates
parameters:
minrust: 1.36.0
minrust: 1.40.0
codecov_token: $(CODECOV_TOKEN_SECRET)

resources:
Expand Down
11 changes: 1 addition & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,8 @@ impl<V> fmt::Debug for Predicate<V> {
}

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

mod write;
Expand Down
2 changes: 0 additions & 2 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ where
entry.insert(Values::with_capacity(additional));
}
},
Operation::__Nonexhaustive => unreachable!(),
}
}

Expand Down Expand Up @@ -718,7 +717,6 @@ where
entry.insert(Values::with_capacity(additional));
}
},
Operation::__Nonexhaustive => unreachable!(),
}
}
}
Expand Down