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 ;
65use num_traits:: Zero ;
7- use rustc_serialize:: { Encodable , Encoder } ;
86use serde:: de:: { Deserialize , Deserializer } ;
97use serde:: ser:: { Serialize , Serializer } ;
108use std:: default:: Default ;
@@ -24,10 +22,6 @@ pub const AU_PER_PX: i32 = 60;
2422/// panics and overflows.
2523pub struct Au ( pub i32 ) ;
2624
27- impl HeapSizeOf for Au {
28- fn heap_size_of_children ( & self ) -> usize { 0 }
29- }
30-
3125impl < ' 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 {
6458pub const MAX_AU : Au = Au ( ( 1 << 30 ) - 1 ) ;
6559pub 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-
7361impl 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- }
0 commit comments