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

docs: small overall documentation improvements #1381

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

ThomasFrans
Copy link
Contributor

General improvements to documentation and code clarity.

Describe your changes

  • Add documentation comments to various items
  • Change web API return types from bool/Option to Result
  • Create helper functions with descriptive names instead of comments
  • Remove redundant/confusing types
  • Fix some documentation comments as instructed by cargo doc
  • Rename variables to clear names

Checklist before requesting a review

  • Documentation was updated (i.e. due to changes in keybindings, commands, etc.)
  • Changelog was updated with relevant user-facing changes (eg. not dependency updates,
    not performance improvements, etc.)

@ThomasFrans
Copy link
Contributor Author

I'm adding documentation because I like to work on the project with cargo doc --document-private-items open to get a general overview of a type's functionality. It also helps a lot with language server hover to quickly get information about functions. I think it's a help for new contributors as well to more easily get an idea of what does what.

I changed some code (most notably the web API return types) when it made sense instead of adding comments/documentation. For example, it makes more sense to return Result<(), ()> instead of bool because the former makes clear that the function can fail and how its status is returned, while the latter needs documentation to explain what true or false mean. I don't think it has any performance impact as the compiler probably optimizes the abstractions away.

@ThomasFrans ThomasFrans marked this pull request as ready for review January 28, 2024 21:33
- Add documentation comments to various items
- Change web API return types from bool/Option to Result
- Create helper functions with descriptive names instead of comments
- Remove redundant/confusing types
- Fix some documentation comments as instructed by `cargo doc`
- Rename variables to clear names
Copy link
Owner

@hrkfdn hrkfdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@hrkfdn hrkfdn merged commit c5d666f into hrkfdn:main Feb 1, 2024
5 checks passed
@ThomasFrans ThomasFrans deleted the docs-improve branch February 1, 2024 20:03
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