Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring html_shell.rs to improve readability #108

Closed
Asha20 opened this issue Jan 8, 2022 · 1 comment · Fixed by #109
Closed

Refactoring html_shell.rs to improve readability #108

Asha20 opened this issue Jan 8, 2022 · 1 comment · Fixed by #109

Comments

@Asha20
Copy link
Contributor

Asha20 commented Jan 8, 2022

Hi, I was wondering if I could contribute to the project by helping improve general code quality?

I picked this file in particular as a starting point because it seemed rather small and self-contained, but if you have other suggestions please feel free to let me know.

Here are some of the things I feel could be improved:

  • Remove code duplication here and here.
  • Use newtypes to enforce invariants present in comments here and here.
  • Try to improve readability of the numerous format! calls that embed other strings inside HTML fragments, probably by putting them in separate functions.
@arctic-hen7
Copy link
Member

You're more than welcome to contribute, please go right ahead and open a PR! A very large portion of Perseus is fairly haphazardly written because of how many times I've needed to change things to add new features. I18n in particular turned things into a bit of a pigsty. Any refactoring is appreciated, thank you very much!

I will be doing a major refactor soon to close #4, but that's a little while away.

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 a pull request may close this issue.

2 participants