From 9ba1b541f019723e0cc8fa66944c900581806696 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 4 Feb 2016 11:13:32 +0100 Subject: [PATCH] Implement HeapSizeOf for &'static str --- Cargo.toml | 2 +- src/lib.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c01b708..2914ec1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/lib.rs b/src/lib.rs index 63d045c..8e14f85 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,6 +81,12 @@ impl HeapSizeOf for String { } } +impl HeapSizeOf for &'static str { + fn heap_size_of_children(&self) -> usize { + 0 + } +} + impl HeapSizeOf for Option { fn heap_size_of_children(&self) -> usize { match *self {