Skip to content

Commit

Permalink
Add derive(HeapSizeOf) support.
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Aug 10, 2015
1 parent 564d835 commit 871d719
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ path = "../string-cache/plugin"
optional = true

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

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![cfg_attr(feature = "unstable", feature(plugin, hashmap_hasher, custom_derive))]
#![cfg_attr(feature = "unstable", plugin(string_cache_plugin))]
#![cfg_attr(all(test, feature = "unstable"), feature(test))]
#![cfg_attr(feature = "heap_size", feature(plugin, hashmap_hasher, custom_derive))]
#![cfg_attr(feature = "heap_size", feature(plugin, custom_derive))]
#![cfg_attr(feature = "heap_size", plugin(heapsize_plugin))]

#[cfg(feature = "heap_size")] extern crate heapsize;
Expand Down
4 changes: 4 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,30 @@ pub enum SimpleSelector {


#[derive(Eq, PartialEq, Clone, Hash, Copy, Debug)]
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
pub enum CaseSensitivity {
CaseSensitive, // Selectors spec says language-defined, but HTML says sensitive.
CaseInsensitive,
}


#[derive(Eq, PartialEq, Clone, Hash, Debug)]
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
pub struct LocalName {
pub name: Atom,
pub lower_name: Atom,
}

#[derive(Eq, PartialEq, Clone, Hash, Debug)]
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
pub struct AttrSelector {
pub name: Atom,
pub lower_name: Atom,
pub namespace: NamespaceConstraint,
}

#[derive(Eq, PartialEq, Clone, Hash, Debug)]
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
pub enum NamespaceConstraint {
Any,
Specific(Namespace),
Expand Down

0 comments on commit 871d719

Please sign in to comment.