@@ -88,7 +88,7 @@ macro_rules! impl_format_escaped_tuple {
88
88
{
89
89
fn format_escaped( buf: & mut String , tup: Self ) {
90
90
$(
91
- let _ = FormatEscaped :: format_escaped( buf, tup. $idx) ;
91
+ FormatEscaped :: format_escaped( buf, tup. $idx) ;
92
92
) +
93
93
}
94
94
}
@@ -133,10 +133,10 @@ impl<T: FormatEscaped> FormatEscaped for Option<T> {
133
133
fn format_escaped ( buf : & mut String , opt : Option < T > ) {
134
134
match opt {
135
135
None => {
136
- let _ = FormatEscaped :: format_escaped ( buf, "none" ) ;
136
+ FormatEscaped :: format_escaped ( buf, "none" ) ;
137
137
}
138
138
Some ( x) => {
139
- let _ = FormatEscaped :: format_escaped ( buf, x) ;
139
+ FormatEscaped :: format_escaped ( buf, x) ;
140
140
}
141
141
}
142
142
}
@@ -198,7 +198,7 @@ impl<'a> AttrWriter<'a, Init> {
198
198
AttrWriter {
199
199
buf : self . buf ,
200
200
tag : self . tag . clone ( ) ,
201
- tag_stack : & mut self . tag_stack ,
201
+ tag_stack : self . tag_stack ,
202
202
state : Default :: default ( ) ,
203
203
}
204
204
}
@@ -223,14 +223,9 @@ impl<'a> AttrWriter<'a, Value> {
223
223
224
224
impl < ' a > SVGBackend < ' a > {
225
225
fn escape_and_push ( buf : & mut String , value : & str ) {
226
- value. chars ( ) . for_each ( |c| match c {
227
- '<' => buf. push_str ( "<" ) ,
228
- '>' => buf. push_str ( ">" ) ,
229
- '&' => buf. push_str ( "&" ) ,
230
- '"' => buf. push_str ( """ ) ,
231
- '\'' => buf. push_str ( "'" ) ,
232
- other => buf. push ( other) ,
233
- } ) ;
226
+ value
227
+ . chars ( )
228
+ . for_each ( |c| FormatEscaped :: format_escaped ( buf, c) ) ;
234
229
}
235
230
236
231
fn close_tag ( & mut self ) -> bool {
@@ -245,7 +240,7 @@ impl<'a> SVGBackend<'a> {
245
240
}
246
241
247
242
/// Opens a tag and provides facilities for writing attrs and closing the tag
248
- fn open_tag < ' s > ( & ' s mut self , tag : SVGTag ) -> AttrWriter < ' s , Init > {
243
+ fn open_tag ( & mut self , tag : SVGTag ) -> AttrWriter < ' _ , Init > {
249
244
AttrWriter :: open_tag ( self . target . get_mut ( ) , tag, & mut self . tag_stack )
250
245
}
251
246
@@ -356,10 +351,10 @@ impl<'a> DrawingBackend for SVGBackend<'a> {
356
351
attrwriter. write_key ( "width" ) . write_value ( "1" ) ;
357
352
attrwriter. write_key ( "height" ) . write_value ( "1" ) ;
358
353
attrwriter. write_key ( "stroke" ) . write_value ( "none" ) ;
354
+ attrwriter. write_key ( "opacity" ) . write_value ( color. alpha ) ;
359
355
attrwriter
360
- . write_key ( "opacity " )
356
+ . write_key ( "fill " )
361
357
. write_value ( make_svg_color ( color) ) ;
362
- attrwriter. write_key ( "fill" ) . write_value ( color. alpha ) ;
363
358
attrwriter. close ( ) ;
364
359
Ok ( ( ) )
365
360
}
0 commit comments