Skip to content

Commit 28ad0f9

Browse files
committed
Remove use of heapsize_plugin
1 parent 9a6179b commit 28ad0f9

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ script:
88
- cargo build --verbose
99
- cargo test --verbose
1010
- cargo doc --verbose
11-
- ([ $TRAVIS_RUST_VERSION != nightly ] || cargo test --features heap_size)
11+
- cargo test --features heapsize
1212

1313
after_success: |
1414
[ $TRAVIS_RUST_VERSION = nightly ] &&

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ tempdir = "0.3"
1919
[dependencies]
2020
encoding = "0.2"
2121
heapsize = {version = ">=0.1.1, <0.4.0", optional = true}
22-
heapsize_plugin = {version = "0.1.0", optional = true}
2322
matches = "0.1"
2423
serde = {version = ">=0.6.6, <0.8", optional = true}
2524
serde_macros = {version = ">=0.6.5, <0.8", optional = true}
2625

2726
[features]
2827
serde-serialization = [ "serde", "serde_macros" ]
29-
heap_size = [ "heapsize", "heapsize_plugin" ]
28+
heap_size = [ "heapsize" ]

src/color.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use super::{Token, Parser, ToCss};
1010
/// A color with red, green, blue, and alpha components.
1111
#[derive(Clone, Copy, PartialEq, Debug)]
1212
#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
13-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
1413
pub struct RGBA {
1514
/// The red channel. Nominally in 0.0 ... 1.0.
1615
pub red: f32,
@@ -22,6 +21,9 @@ pub struct RGBA {
2221
pub alpha: f32,
2322
}
2423

24+
#[cfg(feature = "heapsize")]
25+
known_heap_size!(0, RGBA);
26+
2527
impl ToCss for RGBA {
2628
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
2729
if self.alpha == 1f32 {
@@ -41,14 +43,16 @@ impl ToCss for RGBA {
4143

4244
/// A <color> value.
4345
#[derive(Clone, Copy, PartialEq, Debug)]
44-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
4546
pub enum Color {
4647
/// The 'currentColor' keyword
4748
CurrentColor,
4849
/// Everything else gets converted to RGBA during parsing
4950
RGBA(RGBA),
5051
}
5152

53+
#[cfg(feature = "heapsize")]
54+
known_heap_size!(0, Color);
55+
5256
impl ToCss for Color {
5357
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
5458
match self {

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
#![cfg_attr(feature = "serde-serialization", feature(custom_derive))]
1010
#![cfg_attr(feature = "serde-serialization", feature(plugin))]
1111
#![cfg_attr(feature = "serde-serialization", plugin(serde_macros))]
12-
#![cfg_attr(feature = "heap_size", feature(custom_derive))]
13-
#![cfg_attr(feature = "heap_size", feature(plugin))]
14-
#![cfg_attr(feature = "heap_size", plugin(heapsize_plugin))]
1512

1613
/*!
1714
@@ -76,7 +73,7 @@ extern crate encoding;
7673
#[cfg(test)] extern crate tempdir;
7774
#[cfg(test)] extern crate rustc_serialize;
7875
#[cfg(feature = "serde-serialization")] extern crate serde;
79-
#[cfg(feature = "heap_size")] extern crate heapsize;
76+
#[cfg(feature = "heapsize")] #[macro_use] extern crate heapsize;
8077

8178
pub use tokenizer::{Token, NumericValue, PercentageValue, SourceLocation};
8279
pub use rules_and_declarations::{parse_important};

src/serializer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,11 @@ impl_tocss_for_number!(u64);
314314

315315
/// A category of token. See the `needs_separator_when_before` method.
316316
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
317-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
318317
pub struct TokenSerializationType(TokenSerializationTypeVariants);
319318

319+
#[cfg(feature = "heapsize")]
320+
known_heap_size!(0, TokenSerializationType);
321+
320322
impl TokenSerializationType {
321323
/// Return a value that represents the absence of a token, e.g. before the start of the input.
322324
pub fn nothing() -> TokenSerializationType {
@@ -363,7 +365,6 @@ impl TokenSerializationType {
363365
}
364366

365367
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
366-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
367368
enum TokenSerializationTypeVariants {
368369
Nothing,
369370
WhiteSpace,

0 commit comments

Comments
 (0)