MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / or_default

Method or_default

src/entity/sparse.rs:445–453  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

443 /// reference to it. Otherwise a mutable reference to an already existent value is returned.
444 #[inline]
445 pub fn or_default(self) -> &'a mut V
446 where
447 V: Default,
448 {
449 match self {
450 Entry::Occupied(entry) => entry.into_mut(),
451 Entry::Vacant(entry) => entry.insert(V::default()),
452 }
453 }
454}
455
456impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for Entry<'_, K, V>

Callers 6

initial_valueMethod · 0.80
process_editMethod · 0.80
add_valueMethod · 0.80
set_valueMethod · 0.80
restore_valuesMethod · 0.80

Calls 2

into_mutMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected