Skip to content

Commit 849004e

Browse files
committed
refactor: add inclusive and exclusive bounds to Range
1 parent afe8d24 commit 849004e

File tree

3 files changed

+377
-264
lines changed

3 files changed

+377
-264
lines changed

src/internal/small_vec.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::fmt;
2+
use std::hash::{Hash, Hasher};
23
use std::ops::Deref;
34

45
#[derive(Clone)]
@@ -108,6 +109,13 @@ impl<T: fmt::Debug> fmt::Debug for SmallVec<T> {
108109
}
109110
}
110111

112+
impl<T: Hash> Hash for SmallVec<T> {
113+
fn hash<H: Hasher>(&self, state: &mut H) {
114+
self.len().hash(state);
115+
Hash::hash_slice(self.as_slice(), state);
116+
}
117+
}
118+
111119
#[cfg(feature = "serde")]
112120
impl<T: serde::Serialize> serde::Serialize for SmallVec<T> {
113121
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {

0 commit comments

Comments
 (0)