@@ -20,6 +20,7 @@ use svg;
2020use axis;
2121use representation:: Representation ;
2222use svg_render;
23+ use style;
2324
2425#[ derive( Debug , Default ) ]
2526pub struct Style {
@@ -31,22 +32,24 @@ impl Style {
3132 Style { colour : None }
3233 }
3334
34- pub fn overlay ( & mut self , other : Self ) {
35+ pub fn overlay ( & mut self , other : & Self ) {
3536 match other. colour {
36- Some ( v) => self . colour = Some ( v) ,
37+ Some ( ref v) => self . colour = Some ( v. clone ( ) ) ,
3738 None => { }
3839 }
3940 }
41+ }
4042
41- pub fn colour < T > ( mut self , value : T ) -> Self
43+ impl style:: Line for Style {
44+ fn colour < T > ( & mut self , value : T ) -> & mut Self
4245 where
4346 T : Into < String > ,
4447 {
4548 self . colour = Some ( value. into ( ) ) ;
4649 self
4750 }
4851
49- pub fn get_colour ( & self ) -> String {
52+ fn get_colour ( & self ) -> String {
5053 match self . colour . clone ( ) {
5154 Some ( v) => v,
5255 None => "" . into ( ) ,
@@ -75,8 +78,8 @@ impl Function {
7578 }
7679 }
7780
78- pub fn style ( mut self , style : Style ) -> Self {
79- self . style . overlay ( style) ;
81+ pub fn style ( mut self , style : & Style ) -> Self {
82+ self . style . overlay ( & style) ;
8083 self
8184 }
8285
0 commit comments