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

Method or_insert

src/entity/sparse.rs:384–389  ·  view source on GitHub ↗
(self, default: V)

Source from the content-addressed store, hash-verified

382 match self {
383 Entry::Occupied(entry) => entry.into_mut(),
384 Entry::Vacant(entry) => entry.insert(default),
385 }
386 }
387
388 /// Inserts the result of the `call` function in the entry if it is vacant and returns a mutable
389 /// reference to it. Otherwise a mutable reference to an already existent value is returned.
390 #[inline]
391 pub fn or_insert_with<F>(self, call: F) -> &'a mut V
392 where

Callers 1

computeMethod · 0.80

Calls 2

into_mutMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected