dcz,
@dcz@fosstodon.org avatar

A part of that doesn't get mentioned but is a ridiculous quality of life boon:

dbg!()

Just #[derive(Debug)] on a struct and print it. Suddenly you get insight into what's going on. Very rarely do you need to write your own print.

Insert a dbg in the middle of anything

let diffi = debug!(diffs).iter();

and you get a message with line number and the name of variable:

[src/lib.rs:192:19] diffs = [16, 86, 11]

Not even has that!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rust
  • PowerRangers
  • DreamBathrooms
  • magazineikmin
  • Youngstown
  • tacticalgear
  • everett
  • slotface
  • khanakhh
  • mdbf
  • rosin
  • kavyap
  • GTA5RPClips
  • ngwrru68w68
  • InstantRegret
  • provamag3
  • Durango
  • thenastyranch
  • cubers
  • osvaldo12
  • ethstaker
  • modclub
  • normalnudes
  • vwfavf
  • cisconetworking
  • tester
  • Leos
  • anitta
  • megavids
  • All magazines