scalar_map
map for scalar types.
let num: = Some;
assert_eq!;
let num: i32 = 42;
assert_eq!;
let num: = Some;
assert_eq!;
let num: i32 = 42;
assert_eq!;
What does it solve
-
You can still keep
mapandand_thenintact even ifOptionis refactored out. -
You want
x.map.map...instead of
new
Custom struct
Deriving
# Run this to add the `derive` feature
;
let num = MyNum;
assert_eq!;
Without deriving
;
let num = MyNum;
assert_eq!;