mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 03:56:12 +02:00
🔧 Avoid using global static mut variables when possible
This commit is contained in:
parent
0279e75c4b
commit
3a8ba4cbee
6 changed files with 270 additions and 218 deletions
|
@ -59,12 +59,11 @@ impl<'a> State<'a> {
|
|||
let new_shape = Shape::new(id);
|
||||
self.shapes.insert(id, new_shape);
|
||||
}
|
||||
|
||||
self.current_id = Some(id);
|
||||
self.current_shape = self.shapes.get_mut(&id);
|
||||
}
|
||||
|
||||
pub fn current_shape(&'a mut self) -> Option<&'a mut Shape> {
|
||||
pub fn current_shape(&mut self) -> Option<&mut Shape> {
|
||||
self.current_shape.as_deref_mut()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue