@@ -149,7 +149,6 @@ fn hatch(path: &Path, normal: Line, ratio: Scalar) -> Path {
149149    // all segments grouped by subpath with included closing lines 
150150    let  segments:  Vec < _ >  = path
151151        . subpaths ( ) 
152-         . iter ( ) 
153152        . map ( |subpath| { 
154153            let  last = subpath
155154                . end ( ) 
@@ -164,7 +163,7 @@ fn hatch(path: &Path, normal: Line, ratio: Scalar) -> Path {
164163        } ) 
165164        . collect ( ) ; 
166165
167-     let  mut  subpaths_out  = Vec :: new ( ) ; 
166+     let  mut  path  = Path :: empty ( ) ; 
168167    let  mut  offset_y = 0.0 ; 
169168    while  offset_y < bbox_tr. height ( )  + period { 
170169        let  ints_low = intersect ( 
@@ -282,17 +281,15 @@ fn hatch(path: &Path, normal: Line, ratio: Scalar) -> Path {
282281                    break ; 
283282                } 
284283            } 
285-             if  let  Some ( subpath)  = SubPath :: new ( subpath_out,  true )  { 
286-                 subpaths_out. push ( subpath) ; 
287-             } 
284+             path. push ( & subpath_out,  true ) ; 
288285        } 
289286
290287        // TODO: 
291288        //   - include subpath, when bounding box fits between low and high lines 
292289        offset_y += period; 
293290    } 
294291
295-     Path :: new ( subpaths_out ) 
292+     path 
296293} 
297294
298295fn  generate_bar ( 
@@ -313,18 +310,18 @@ fn generate_bar(
313310        let  by = bbox. y ( )  + border; 
314311        let  bh = ( bbox. height ( )  - 2.0  *  border)  *  ( 1.0  - frac) ; 
315312        let  bw = bbox. width ( )  - 2.0  *  border; 
316-         let  border = Path :: builder ( ) 
313+         let  mut   border = Path :: builder ( ) 
317314            . move_to ( ( bx,  by) ) 
318315            . rbox ( ( bw,  bh) ,  radii) 
319-             . build ( ) 
320-              . reverse ( ) ; 
321-         path. extend ( border) ; 
316+             . build ( ) ; 
317+         border . reverse ( ) ; 
318+         path. extend ( & border) ; 
322319        let  ib = hatch_normal. length ( )  *  hatch_ratio; 
323320        let  hatch_path = Path :: builder ( ) 
324321            . move_to ( ( bx + ib,  by + ib) ) 
325322            . rbox ( ( bw - 2.0  *  ib,  bh - 2.0  *  ib) ,  radii) 
326323            . build ( ) ; 
327-         path. extend ( hatch ( & hatch_path,  hatch_normal,  hatch_ratio) ) ; 
324+         path. extend ( & hatch ( & hatch_path,  hatch_normal,  hatch_ratio) ) ; 
328325    } 
329326    path
330327} 
@@ -419,7 +416,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
419416            Line :: new ( ( 0.0 ,  0.0 ) ,  ( 70.0 ,  70.0 ) ) , 
420417            0.3 , 
421418        ) ; 
422-         path. extend ( charging. clone ( ) ) ; 
419+         path. extend ( & charging) ; 
423420        path. transform ( tr) ; 
424421        glyphs. push ( Glyph  { 
425422            path, 
0 commit comments