[librsvg] PathBuilder: re-slice directly, not with .get().unwrap()



commit ac83089a6c0d9a22e80b50081e85ff74c99daf12
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Mar 27 13:18:59 2020 -0600

    PathBuilder: re-slice directly, not with .get().unwrap()
    
    Thanks to Sergey Bugaev for the suggestion.

 rsvg_internals/src/path_builder.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/path_builder.rs b/rsvg_internals/src/path_builder.rs
index 7544c505..464e5a94 100644
--- a/rsvg_internals/src/path_builder.rs
+++ b/rsvg_internals/src/path_builder.rs
@@ -490,7 +490,7 @@ impl PathBuilder {
 
         for c in self.path_commands {
             let n = c.num_coordinates();
-            packed_commands.push(c.to_packed(coords_slice.get_mut(0..n).unwrap()));
+            packed_commands.push(c.to_packed(&mut coords_slice[..n]));
             coords_slice = &mut coords_slice[n..];
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]