-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix clippy::missing-panics-doc warning #54
Comments
Taking this one since Lillian didn't want it :-) |
edmorley
added a commit
that referenced
this issue
Nov 11, 2021
Switches the `panic!` in `LayerEnv::read_from_layer_dir()` to `unreachable!`, since: - it more clearly indicates the intent (unreachable code unless there is a bug) - it means we can globally enable the `clippy::missing-panics-doc` lint, without having to either: (a) add an unnecessary `# Panic` section to the docs (which would only add noise, given the caller needn't be aware of panics for internal bugs) (b) add an `#[allow(...)]` annotation to all of `read_from_layer_dir`, which could mean future new undocumented panics aren't caught by clippy. Fixes #54.
edmorley
added a commit
that referenced
this issue
Nov 11, 2021
Switches the `panic!` in `LayerEnv::read_from_layer_dir()` to `unreachable!`, since: - it more clearly indicates the intent (unreachable code unless there is a bug) - it means we can globally enable the `clippy::missing-panics-doc` lint, without having to either: (a) add an unnecessary `# Panic` section to the docs (which would only add noise, given the caller needn't be aware of panics for internal bugs) (b) add an `#[allow(...)]` annotation to all of `read_from_layer_dir()`, which could mean future new undocumented panics aren't caught by clippy. Fixes #54.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran Clippy's pedantic lints (which are disabled by default since they are typically subjective or have high false positive rates) against this repository out of curiosity, and am filing a few issues for some of the lints that warned that seemed relevant (in part to give some easy issues for people to work through to get involved with this library).
Feel free to close this out if not wanted :-)
See:
https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
https://rust-lang.github.io/api-guidelines/documentation.html#function-docs-include-error-panic-and-safety-considerations-c-failure
The text was updated successfully, but these errors were encountered: