jroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agoknow the features of your languagelemmy.worldimagemessage-square144fedilinkarrow-up1637
arrow-up1637imageknow the features of your languagelemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 1 year agomessage-square144fedilink
minus-squarebarsoap@lemm.eelinkfedilinkarrow-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: