Clean up mesh.rs
This commit is contained in:
parent
8a3dac008a
commit
257acf56d2
|
@ -92,7 +92,7 @@ impl AttrStore {
|
||||||
/// existing [AttrId].
|
/// existing [AttrId].
|
||||||
pub fn get_type<T: 'static + Attribute>(&self) -> AttrId {
|
pub fn get_type<T: 'static + Attribute>(&self) -> AttrId {
|
||||||
let type_id = TypeId::of::<T>();
|
let type_id = TypeId::of::<T>();
|
||||||
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 {
|
if let Some(id) = existing_id {
|
||||||
id
|
id
|
||||||
|
@ -113,7 +113,7 @@ impl AttrStore {
|
||||||
|
|
||||||
/// Gets the [AttrInfo] for an [AttrId].
|
/// Gets the [AttrInfo] for an [AttrId].
|
||||||
pub fn get_info(&self, id: &AttrId) -> Option<AttrInfo> {
|
pub fn get_info(&self, id: &AttrId) -> Option<AttrInfo> {
|
||||||
self.attributes.read().unwrap().get(id.0).map(|v| v.clone())
|
self.attributes.read().unwrap().get(id.0).copied()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue