// source: https://doc.rust-lang.org/std/result/enum.Result.html#method.map_or auto x = Result!string.ok("foo"); assert(x.fmapOr!(str => str.length)(42) == 3); auto y = Result!string.err("bar"); assert(y.fmapOr!(str => str.length)(42) == 42);
See Implementation