From 257acf56d2fb66d2a7555b433f06c3ed2987c63d Mon Sep 17 00:00:00 2001 From: mars Date: Mon, 18 Apr 2022 20:20:35 -0600 Subject: [PATCH] Clean up mesh.rs --- src/mesh.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh.rs b/src/mesh.rs index 2fea9d1..cef1596 100644 --- a/src/mesh.rs +++ b/src/mesh.rs @@ -92,7 +92,7 @@ impl AttrStore { /// existing [AttrId]. pub fn get_type(&self) -> AttrId { let type_id = TypeId::of::(); - let existing_id = self.types.read().unwrap().get(&type_id).map(|v| *v); + let existing_id = self.types.read().unwrap().get(&type_id).copied(); if let Some(id) = existing_id { id @@ -113,7 +113,7 @@ impl AttrStore { /// Gets the [AttrInfo] for an [AttrId]. pub fn get_info(&self, id: &AttrId) -> Option { - self.attributes.read().unwrap().get(id.0).map(|v| v.clone()) + self.attributes.read().unwrap().get(id.0).copied() } }