Skip to content

Commit 2a3ba23

Browse files
author
bors-servo
authored
Auto merge of #39 - servo:heapsize, r=nox
Remove heapsize and rustc_serialize support
2 parents 3a937a4 + 5b4e48e commit 2a3ba23

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
[package]
22
name = "app_units"
3-
version = "0.5.6"
3+
version = "0.6.0"
44
authors = ["The Servo Project Developers"]
55
description = "Servo app units type (Au)"
66
documentation = "http://doc.servo.org/app_units/"
77
repository = "https://github.com/servo/app_units"
88
license = "MPL-2.0"
99

1010
[dependencies]
11-
heapsize = ">=0.3, < 0.5"
1211
num-traits = "0.1.32"
13-
rustc-serialize = "0.3"
1412
serde = "1.0"

src/app_unit.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
use heapsize::HeapSizeOf;
65
use num_traits::Zero;
7-
use rustc_serialize::{Encodable, Encoder};
86
use serde::de::{Deserialize, Deserializer};
97
use serde::ser::{Serialize, Serializer};
108
use std::default::Default;
@@ -24,10 +22,6 @@ pub const AU_PER_PX: i32 = 60;
2422
/// panics and overflows.
2523
pub struct Au(pub i32);
2624

27-
impl HeapSizeOf for Au {
28-
fn heap_size_of_children(&self) -> usize { 0 }
29-
}
30-
3125
impl<'de> Deserialize<'de> for Au {
3226
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Au, D::Error> {
3327
Ok(Au(try!(i32::deserialize(deserializer))).clamp())
@@ -64,12 +58,6 @@ impl Zero for Au {
6458
pub const MAX_AU: Au = Au((1 << 30) - 1);
6559
pub const MIN_AU: Au = Au(- ((1 << 30) - 1));
6660

67-
impl Encodable for Au {
68-
fn encode<S: Encoder>(&self, e: &mut S) -> Result<(), S::Error> {
69-
e.emit_f64(self.to_f64_px())
70-
}
71-
}
72-
7361
impl fmt::Debug for Au {
7462
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7563
write!(f, "{}px", self.to_f64_px())
@@ -379,10 +367,3 @@ fn convert() {
379367
assert_eq!(Au::from_f64_px(6.12), Au(367));
380368
assert_eq!(Au::from_f64_px(6.13), Au(368));
381369
}
382-
383-
#[test]
384-
fn heapsize() {
385-
use heapsize::HeapSizeOf;
386-
fn f<T: HeapSizeOf>(_: T) {}
387-
f(Au::new(0));
388-
}

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
//! originally proposed in 2002 as a standard unit of measure in Gecko.
77
//! See <https://bugzilla.mozilla.org/show_bug.cgi?id=177805> for more info.
88
9-
extern crate heapsize;
109
extern crate num_traits;
11-
extern crate rustc_serialize;
1210
extern crate serde;
1311

1412
mod app_unit;

0 commit comments

Comments
 (0)