MCPcopy Create free account
hub / github.com/PRQL/prql / or_map

Method or_map

prqlc/prqlc/src/utils/mod.rs:23–32  ·  view source on GitHub ↗
(self, b: Self, f: F)

Source from the content-addressed store, hash-verified

21
22impl<T> OrMap<T> for Option<T> {
23 fn or_map<F>(self, b: Self, f: F) -> Self
24 where
25 F: FnOnce(T, T) -> T,
26 {
27 match (self, b) {
28 (Some(a), Some(b)) => Some(f(a, b)),
29 (a, None) => a,
30 (None, b) => b,
31 }
32 }
33}
34
35pub trait Pluck<T> {

Callers 1

range_of_rangesFunction · 0.80

Calls 1

fFunction · 0.50

Tested by

no test coverage detected