File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,12 @@ impl<T> Calc for T where T: Clone + Debug + 'static {}
6868pub  trait  Units  { 
6969    /// Trait that represents a cheaply clonable string. If you're unsure what to use here 
7070/// consider `Arc<str>` or `string_cache::Atom`. 
71+ #[ cfg( not( feature = "serde" ) ) ]  
7172    type  Str :  CheapCloneStr ; 
73+     /// Trait that represents a cheaply clonable string. If you're unsure what to use here 
74+ /// consider `Arc<str>` or `string_cache::Atom`. 
75+ #[ cfg( feature = "serde" ) ]  
76+     type  Str :  CheapCloneStr  + serde:: Serialize  + for < ' a >  serde:: Deserialize < ' a > ; 
7277
7378    /// Type representing a calc expression. 
7479/// If you're not using Calc then you can just use `()` 
Original file line number Diff line number Diff line change 22#[ cfg( feature = "serde" ) ]  
33mod  serde { 
44    use  serde_json:: { self ,  Value } ; 
5-     use  taffy:: style :: Style ; 
5+     use  taffy:: { DefaultUnits ,   Style } ; 
66
77    #[ test]  
88    fn  serde_can_serialize ( )  { 
9-         let  style:  Style < String >  = Style :: DEFAULT ; 
9+         let  style:  Style < DefaultUnits >  = Style :: DEFAULT ; 
1010        let  _ = serde_json:: to_string ( & style) . unwrap ( ) ; 
1111    } 
1212
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments