minus-squarelarix@programming.devOPtoRust@programming.dev•since: my first projectlinkfedilinkarrow-up1·edit-25 months agoThank you very much. I’ll change it. I did run cargo clippy, but it didn’t complained anything anymore before I published the code. 🙂 One question to return value Option<&String>: is it better to change to Option<&str> or &Option<String> if the value in the struct is a Option<String>? The latter sounds more logical to me. linkfedilink
larix@programming.dev to Rust@programming.dev · edit-25 months agosince: my first projectplus-squarecodeberg.orgexternal-linkmessage-square2fedilinkarrow-up10arrow-down10
arrow-up10arrow-down1external-linksince: my first projectplus-squarecodeberg.orglarix@programming.dev to Rust@programming.dev · edit-25 months agomessage-square2fedilink
Thank you very much. I’ll change it. I did run cargo clippy, but it didn’t complained anything anymore before I published the code. 🙂
One question to return value
Option<&String>
:is it better to change to
Option<&str>
or&Option<String>
if the value in the struct is aOption<String>
? The latter sounds more logical to me.