jroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agoknow the features of your languagelemmy.worldimagemessage-square148fedilinkarrow-up1647arrow-down124
arrow-up1623arrow-down1imageknow the features of your languagelemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agomessage-square148fedilink
minus-squarebarsoaplinkfedilinkarrow-up1·11 months agoMaybe shouldn’t call the function anything default and also provide it. The std docs say: fn count(x: &str) -> usize { x.len() } assert_eq!(Ok(2).unwrap_or_else(count), 2); assert_eq!(Err("foo").unwrap_or_else(count), 3);
Maybe shouldn’t call the function anything
default
and also provide it. The std docs say: