1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

feat(core/rust): add Map::is_empty()

This commit is contained in:
matejcik 2024-01-19 12:08:42 +01:00 committed by Jiří Musil
parent 9c72c7c99d
commit 63360a7417

View File

@ -69,6 +69,10 @@ impl Map {
self.used() self.used()
} }
pub fn is_empty(&self) -> bool {
self.len() == 0
}
pub fn elems(&self) -> &[MapElem] { pub fn elems(&self) -> &[MapElem] {
// SAFETY: `self.table` should always point to an array of `MapElem` of // SAFETY: `self.table` should always point to an array of `MapElem` of
// `self.len()` items valid at least for the lifetime of `self`. // `self.len()` items valid at least for the lifetime of `self`.