Closed mfdorst closed 3 years ago
Thanks for your contribution. Do you know if there is a way to check formatting at compile time ?
@yazgoo you mean other than running cargo fmt
? Not that I'm aware of, but there might be. Perhaps you can add a hook to cargo build
? If you're interested in ensuring that PRs to this repo are formatted properly you can use CI to do that.
https://github.com/rust-lang/rustfmt#checking-style-on-a-ci-server
Move some deeply nested code out into dedicated functions, such as
handle_key_press()
,handle_button_press()
,resize_bsp()
andresize_monocle()
. This makes a lot of logic easier to follow, and also reduces indentation several levels.Replace single arm
match
statements withif let
, e.g.:becomes
This removes a level of indentation.
Replace
let _ = x
withx.ok()
. No reason for this other than I think it looks better.This PR supersedes #21 (it is based on top of the edits in that PR).