From 4afdb61b87fd98e89b7d59396cfc732fc7937b1b Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Sat, 11 Feb 2023 11:54:30 +0100 Subject: [PATCH] type dict: add get_typename --- nested/src/type_system/type_term.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nested/src/type_system/type_term.rs b/nested/src/type_system/type_term.rs index b153177..41f5f17 100644 --- a/nested/src/type_system/type_term.rs +++ b/nested/src/type_system/type_term.rs @@ -144,12 +144,12 @@ impl TypeDict { tyid } + pub fn get_typename(&self, tid: &u64) -> Option { + self.typenames.my.get(tid).cloned() + } + pub fn get_typeid(&self, tn: &String) -> Option { - if let Some(id) = self.typenames.mλ.get(tn) { - Some(*id) - } else { - None - } + self.typenames.mλ.get(tn).cloned() } pub fn type_term_from_str(&self, typename: &str) -> Option {