HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-22 days agoWhy make it complicated?imagemessage-square116linkfedilinkarrow-up1361arrow-down137file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1324arrow-down1imageWhy make it complicated?HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · edit-22 days agomessage-square116linkfedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squarenebeker@programming.devlinkfedilinkEnglisharrow-up8·2 days agolet a = String::from(“Hello, world!”).into() I’ll see myself out.
minus-squareanton@lemmy.blahaj.zonelinkfedilinkarrow-up4·1 day agoAt least be fair and cut out the .into()
minus-squarenebeker@programming.devlinkfedilinkEnglisharrow-up3·23 hours agoAnd bow to the compiler’s whims? I think not! This shouldn’t compile, because .into needs the type from the left side and let needs the type from the right side.
let a = String::from(“Hello, world!”).into()
I’ll see myself out.
At least be fair and cut out the
.into()
And bow to the compiler’s whims? I think not!
This shouldn’t compile, because .into needs the type from the left side and let needs the type from the right side.