Elektrine lite

← Feed

@jjj@piefed.blahaj.zone

2026-10-25 06:41 UTC

…which is why I love #[rustfmt::skip] so much! You can do stuff like #[rustfmt::skip] const DIRECTIONS: [[i8; 2]; 4] = [ [0, 1], [-1, 0], [1, 0], [0, -1], ] while still enjoying the convenience of auto formatting elsewhere. Although linters which act on the behavior of code are unequivocally a good thing, e.g. “hey, this comparison will always return false you probably made a mistake here”.

Replies (1)

  • @calcopiritus@lemmy.world 2026-10-25 13:50

    Any formatter annotation just clutters the code though. Except maybe if it is file-wide. I prefer that my editor formats it in a sensible way as I code. If there’s something I wanna do with a different formatting, I just do so. But the rest is formatted as I write it, instead of afterwards.

    Open ##5240202