Skip to content

Conversation

@panicbit
Copy link
Contributor

This PR refactors most of the smaller functions.
The most significant refactoring changes include:

  • using let-else to reduce nesting
  • using .context() / .with_context() to add context to anyhow's errors
  • liberal use of variables to prevent long lines

Additionally, the main app loop got extracted from main into the run_app function.
The reason for this is to ensure that the terminal is always getting restored properly,
even if the app returns an error.

I'm very tempted to also split up some of the larger functions and move some stuff into new modules, but last time I tried that I ended up with nasty merge conflicts 🥲.

@bitmagier bitmagier self-assigned this May 30, 2025
@bitmagier bitmagier merged commit b726f66 into bitmagier:main May 30, 2025
1 check passed
@bitmagier
Copy link
Owner

Nice facelift. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants