Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Apr 16, 2022
1 parent 83219ce commit ba70541
Show file tree
Hide file tree
Showing 6 changed files with 290 additions and 123 deletions.
18 changes: 10 additions & 8 deletions src/heapsize.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate heapsize;

use self::heapsize::{HeapSizeOf, heap_size_of};
use std::hash::{Hash, BuildHasher};
use self::heapsize::{heap_size_of, HeapSizeOf};
use std::hash::{BuildHasher, Hash};

use {LinkedHashMap, KeyRef, Node};
use {KeyRef, LinkedHashMap, Node};

impl<K> HeapSizeOf for KeyRef<K> {
fn heap_size_of_children(&self) -> usize {
Expand All @@ -12,18 +12,20 @@ impl<K> HeapSizeOf for KeyRef<K> {
}

impl<K, V> HeapSizeOf for Node<K, V>
where K: HeapSizeOf,
V: HeapSizeOf
where
K: HeapSizeOf,
V: HeapSizeOf,
{
fn heap_size_of_children(&self) -> usize {
self.key.heap_size_of_children() + self.value.heap_size_of_children()
}
}

impl<K, V, S> HeapSizeOf for LinkedHashMap<K, V, S>
where K: HeapSizeOf + Hash + Eq,
V: HeapSizeOf,
S: BuildHasher
where
K: HeapSizeOf + Hash + Eq,
V: HeapSizeOf,
S: BuildHasher,
{
fn heap_size_of_children(&self) -> usize {
unsafe {
Expand Down
Loading

0 comments on commit ba70541

Please sign in to comment.