summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
93679b2)
Because with expect() the formatting will always be called, even when there is a value.
}
pub fn get(&self, name: &str) -> &Texture {
}
pub fn get(&self, name: &str) -> &Texture {
- self.textures.get(name).expect(format!("The sprite '{}' was not found", name).as_str())
+ self.textures.get(name).unwrap_or_else(|| panic!("The sprite '{}' was not found", name))