Use static string literals instead of String for scene IDs
This commit is contained in:
parent
3692736a61
commit
b3b69756e6
2 changed files with 8 additions and 6 deletions
|
|
@ -29,7 +29,7 @@ impl AsMut<Scene> for Scene {
|
|||
}
|
||||
}
|
||||
|
||||
type SceneID = String;
|
||||
type SceneID = &'static str;
|
||||
|
||||
pub struct SceneManager {
|
||||
scenes: HashMap<SceneID, Scene>,
|
||||
|
|
@ -55,7 +55,7 @@ impl SceneManager {
|
|||
|
||||
pub fn current_mut(&mut self) -> &mut Scene {
|
||||
match &mut self.active_scene {
|
||||
Some(id) => self.scenes.get_mut(id.as_mut()).unwrap().as_mut(),
|
||||
Some(id) => self.scenes.get_mut(id).unwrap().as_mut(),
|
||||
None => panic!("No active scene"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue