MCPcopy Create free account
hub / github.com/RustCrypto/utils / map

Method map

ctutils/src/ct_option.rs:321–326  ·  view source on GitHub ↗
(self, f: F)

Source from the content-addressed store, hash-verified

319 #[inline]
320 #[must_use]
321 pub fn map<U, F>(self, f: F) -> CtOption<U>
322 where
323 F: FnOnce(T) -> U,
324 {
325 CtOption::new(f(self.value), self.is_some)
326 }
327
328 /// Maps a `CtOption<T>` to a `U` value, eagerly evaluating the provided function, and returning
329 /// the supplied `default` in the event `self.is_some()` is [`Choice::FALSE`].

Callers 10

encode_blobsFunction · 0.80
decode_hexFunction · 0.80
as_derefMethod · 0.80
as_deref_mutMethod · 0.80
map_orMethod · 0.80
zip_withMethod · 0.80
derive_zeroize_implFunction · 0.80
generate_fieldsFunction · 0.80
attr_skipFunction · 0.80
get_tail_blockMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected