From c4dac61ab5bd924ed598a1c052a1f71db888ae8a Mon Sep 17 00:00:00 2001 From: ice_iix Date: Fri, 18 Jun 2021 14:55:45 -0700 Subject: [PATCH] Fix clippy::manual_map, no longer manual --- src/gl/mod.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/gl/mod.rs b/src/gl/mod.rs index af5da08..4266169 100644 --- a/src/gl/mod.rs +++ b/src/gl/mod.rs @@ -491,20 +491,12 @@ impl Program { pub fn uniform_location(&self, name: &str) -> Option { 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 { 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)) } }