jroid8@lemmy.world to Programmer Humor@lemmy.ml · 10 months agoknow the features of your languagelemmy.worldimagemessage-square149fedilinkarrow-up1646arrow-down124
arrow-up1622arrow-down1imageknow the features of your languagelemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 10 months agomessage-square149fedilink
minus-squarebarsoaplinkfedilinkarrow-up1·10 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: