Skip to content

Commit

Permalink
Resolve clippy hash warning
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Aug 8, 2023
1 parent 82e5494 commit f4a0fdd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions partiql-value/src/list.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use std::cmp::Ordering;

use std::fmt::{Debug, Formatter};
use std::hash::Hash;
use std::hash::{Hash, Hasher};

use std::{slice, vec};

use crate::{Bag, NullableEq, Value};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

#[derive(Default, Hash, Eq, Clone)]
#[derive(Default, Eq, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
/// Represents a PartiQL List value, e.g. [1, 2, 'one']
pub struct List(Vec<Value>);
Expand Down Expand Up @@ -208,3 +208,11 @@ impl Ord for List {
}
}
}

impl Hash for List {
fn hash<H: Hasher>(&self, state: &mut H) {
for v in self.0.iter() {
v.hash(state);
}
}
}

0 comments on commit f4a0fdd

Please sign in to comment.