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

Commit

Permalink
Auto merge of #35 - nox:static-str, r=Ms2ger
Browse files Browse the repository at this point in the history
Implement HeapSizeOf for &'static str

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/heapsize/35)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Feb 4, 2016
2 parents 3a515a6 + 9ba1b54 commit 201f76d
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 201f76d

Please sign in to comment.