Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Implement HeapSizeOf for &'static str
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Feb 4, 2016
1 parent 3a515a6 commit 9ba1b54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "heapsize"
version = "0.2.4"
version = "0.2.5"
authors = [ "The Servo Project Developers" ]
description = "Infrastructure for measuring the total runtime size of an object on the heap"
license = "MPL-2.0"
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ impl HeapSizeOf for String {
}
}

impl HeapSizeOf for &'static str {
fn heap_size_of_children(&self) -> usize {
0
}
}

impl<T: HeapSizeOf> HeapSizeOf for Option<T> {
fn heap_size_of_children(&self) -> usize {
match *self {
Expand Down

0 comments on commit 9ba1b54

Please sign in to comment.