rayhunter icon indicating copy to clipboard operation
rayhunter copied to clipboard

comment was looking for a rusty way

Open rusmisel opened this issue 1 year ago • 3 comments

was reading the code and noticed a comment looking for a rustier way to do this, so i figured i'd write a quick option. no change to behavior

rusmisel avatar Mar 27 '25 19:03 rusmisel

also i noticed the codebase hasn't been formatted in a while - is there desire for a pre-commit hook or CI job that runs cargo fmt?

rusmisel avatar Mar 27 '25 19:03 rusmisel

I'm not a maintainer, but at least on my end I would love to see all the code go through cargo fmt and ruff format.

Also this implementation is much nicer to read, thank you.

oopsbagel avatar Mar 27 '25 23:03 oopsbagel

@oopsbagel probably best to do the mass format in a separate PR and create a blame.ignoreRevsFile to go along with it so that blames don't all point to the format commit

from there, a pre-commit hook or CI check can be added to ensure it stays formatted going forward

rusmisel avatar Mar 28 '25 11:03 rusmisel

@wgreenberg anything that could be fixed with a rustfmt.toml?

rusmisel avatar Apr 08 '25 17:04 rusmisel

thanks! and re: automatically running cargo fmt, perhaps i'm a heathen for this but i occasionally disagree w/ how fmt feels about certain whitespace decisions. i don't feel particularly strongly about this, though!

Could always include nofmt annotations in the code for certain sections as well. I also don't love 100% of the results of cargo fmt.

oopsbagel avatar Apr 08 '25 18:04 oopsbagel