jroid8@lemmy.world to Programmer Humor@lemmy.ml · 2 years agoknow the features of your languagelemmy.worldimagemessage-square144linkfedilinkarrow-up1637
arrow-up1637imageknow the features of your languagelemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 2 years agomessage-square144linkfedilink
minus-squarebarsoap@lemm.eelinkfedilinkarrow-up1·2 years 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: