Skip to content

Commit

Permalink
Merge pull request #6 from Cyberboss/MoreAdditions
Browse files Browse the repository at this point in the history
Implement GetSize for Box<[T]>
  • Loading branch information
DKerp authored Jun 19, 2023
2 parents 9454e04 + bbcb0fa commit 51ce86a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,14 @@ impl GetSize for std::path::PathBuf {
}

impl GetSize for &std::path::Path {}

impl<T> GetSize for Box<[T]> {
fn get_heap_size(&self) -> usize {
let mut total = 0;
for item in self.iter() {
total += item.get_size()
}

total
}
}

0 comments on commit 51ce86a

Please sign in to comment.