From 63360a741769c95556ad5c455b88a8c012e815c7 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 19 Jan 2024 12:08:42 +0100 Subject: [PATCH] feat(core/rust): add Map::is_empty() --- core/embed/rust/src/micropython/map.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/embed/rust/src/micropython/map.rs b/core/embed/rust/src/micropython/map.rs index e889c250a..51789abd4 100644 --- a/core/embed/rust/src/micropython/map.rs +++ b/core/embed/rust/src/micropython/map.rs @@ -69,6 +69,10 @@ impl Map { self.used() } + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + pub fn elems(&self) -> &[MapElem] { // SAFETY: `self.table` should always point to an array of `MapElem` of // `self.len()` items valid at least for the lifetime of `self`.