little change on hash set

This commit is contained in:
Víctor Martínez 2020-12-09 00:39:07 +01:00
parent a4447d9baa
commit deaaf21949

View file

@ -43,9 +43,11 @@ impl<T: Hash + PartialEq + Clone> HashSet<T> {
match self.data[index] {
Some(ref mut list) => list.push_front(value),
None => {
let mut list = LinkedList::new();
list.push_back(value);
self.data[index] = Some(list)
self.data[index] = {
let mut list = LinkedList::new();
list.push_back(value);
Some(list)
}
}
}
self.size += 1;