}
}
-impl<S> PartialEq for Value<S>
-where
- S: PartialEq,
-{
+impl PartialEq for Value {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Number(Some(l0)), Self::Number(Some(r0))) => {
}
}
-impl<S> Eq for Value<S> where S: Eq {}
+impl Eq for Value {}
impl PartialOrd for Value {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
}
}
-impl<S> Hash for Value<S>
-where
- S: Hash,
-{
+impl Hash for Value {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
match self {
Value::Number(number) => number.map(OrderedFloat).hash(state),
/// Value labels, to associate a number (or a string) with a more meaningful
/// description, e.g. 1 -> Apple, 2 -> Banana, ...
- pub value_labels: HashMap<Value<EncodedString>, String>,
+ pub value_labels: HashMap<Value, String>,
/// Variable label, an optional meaningful description for the variable
/// itself.
/// have the same contents. This is an important optimization for hashing:
/// otherwise, strings could only be hashed if they were converted to a common
/// encoding (probably UTF-8), which would be expensive.
-#[derive(Clone, Eq, Hash)]
+#[derive(Clone)]
pub struct EncodedString {
/// Raw contents.
bytes: RawString,