Elektrine lite

← Feed

@FineFindus@floss.social

2026-07-21 17:42 UTC

@ekuber@hachyderm.io That's pretty neat, but wouldn't it be easier to use the dbg! macro?

Replies (2)

  • @ekuber@hachyderm.io 2026-07-21 17:46

    @FineFindus@floss.social I usually am doing more complex things to filter out the output I want to look at, and `dbg!` passes through the value passed in, which means that if the binding is not boolean, you get a type error: error[E0308]: mismatched types --> src/main.rs:5:29 | 5 | if let Some(x) = Some(1) && dbg!(x) {} | ^^^^^^^ expected `bool`, found integer

    Open ##5313220

  • @pmmeurcatpics@ieji.de 2026-07-21 17:49

    @FineFindus@floss.social @ekuber@hachyderm.io dbg is annoying to quickly comment/uncomment, as it's a part of the line. This block thing, on the other hand, you can just comment out by line

    Open ##5313222