Fix clippy::manual_map, no longer manual

This commit is contained in:
ice_iix 2021-06-18 14:55:45 -07:00
parent 26a22750d5
commit c4dac61ab5
1 changed files with 2 additions and 10 deletions

View File

@ -491,20 +491,12 @@ impl Program {
pub fn uniform_location(&self, name: &str) -> Option<Uniform> {
let u = unsafe { glow_context().get_uniform_location(self.0, name) };
if let Some(u) = u {
Some(Uniform(u))
} else {
None
}
u.map(Uniform)
}
pub fn attribute_location(&self, name: &str) -> Option<Attribute> {
let a = unsafe { glow_context().get_attrib_location(self.0, name) };
if let Some(a) = a {
Some(Attribute(a as i32))
} else {
None
}
a.map(|a| Attribute(a as i32))
}
}