Skip to content

Commit

Permalink
Merge pull request #41 from srishanbhattarai/non-exhaustive-op
Browse files Browse the repository at this point in the history
Mark Operation enum as non_exhaustive
  • Loading branch information
jonhoo authored Jan 30, 2020
2 parents d56d013 + 81e4734 commit b4d8034
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
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

0 comments on commit b4d8034

Please sign in to comment.