Fix clippy and rustfmt errors#3
Merged
dylanmc merged 12 commits intodylanmc:trunkfrom Feb 20, 2023
Merged
Conversation
We deliberately don't run clippy on pedantic mode in CI, because that's a lot to ask right now.
The `Flags` enum needs to be public, since it's part of the `DataSource` API.
Possibly we do want a different name for FileDataSource---maybe just file---but this is the least-friction change.
Using dedicated `Option` and `Result` methods is considered more readable than reimplementing them by hand.
Try running `cargo doc --open`!
You should always annotate functions with no side effects as `must_use` to denote that the user has to do something with the returned value.
This is more idiomatic than a custom panic message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a chore PR to conform the codebase to
clippyandrustfmt. I've madeit conformant in as frictionless a way as possible.
rustfmt.Flagswas previously private, but exposedin the public
DataSourceAPI.FileDataSource. It's possible we'll wantto change the name of this object later, but this is the lowest-friction
change.
FileDataSource::new. It's more idiomatic to use provided methods onOptionandResultthan re-implenting the methods withmatchorif let.cargo doc --open!)should always have this annotation.
todoto panic at todo code sites. This is more idiomatic than writing acustom panic message.