Skip to content

Add HeapSizeOf support. #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 13, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ optional = true
[dependencies.serde_macros]
optional = true

[dependencies.heapsize]
git = "https://github.com/servo/heapsize.git"
optional = true

[dependencies]
encoding = "0.2"
matches = "0.1"

[features]
serde-serialization = [ "serde", "serde_macros" ]

heap_size = [ "heapsize" ]
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ extern crate encoding;
#[cfg(test)] extern crate tempdir;
#[cfg(test)] extern crate rustc_serialize;
#[cfg(feature = "serde-serialization")] extern crate serde;
#[cfg(feature = "heap_size")] #[macro_use] extern crate heapsize;

pub use tokenizer::{Token, NumericValue, PercentageValue, SourceLocation};
pub use rules_and_declarations::{parse_important};
Expand All @@ -83,6 +84,8 @@ pub use nth::parse_nth;
pub use serializer::{ToCss, CssStringWriter, serialize_identifier, serialize_string};
pub use parser::{Parser, Delimiter, Delimiters, SourcePosition};

#[cfg(feature = "heap_size")] known_heap_size!(0, Color, RGBA);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use this over deriving the trait on the types?



/**

Expand Down