snaggen@programming.dev to Rust@programming.dev · 9 months agoAnnouncing Rust 1.76.0blog.rust-lang.orgexternal-linkmessage-square11fedilinkarrow-up10arrow-down10
arrow-up10arrow-down1external-linkAnnouncing Rust 1.76.0blog.rust-lang.orgsnaggen@programming.dev to Rust@programming.dev · 9 months agomessage-square11fedilink
minus-squareanlumo@feddit.delinkfedilinkEnglisharrow-up0·9 months agoOh, inspect has finally arrived! That will help a ton with debug logging.
minus-squareλλλ@programming.devlinkfedilinkarrow-up0·edit-29 months agoDo you mind explaining? Maybe with the context of another languages equivalent?
minus-squareanlumo@feddit.delinkfedilinkEnglisharrow-up0·9 months agolet bar: Result<T, E> = ...; let foo = bar.inspect(|value| log::debug("{}", value)); is equivalent to let bar: Result<T, E> = ...; let foo = bar.map(|value| { log::debug("{}", value); value });
Oh,
inspect
has finally arrived! That will help a ton with debug logging.Do you mind explaining? Maybe with the context of another languages equivalent?
is equivalent to