Fix post-#263 clippy warnings in sudachi crate#330
Closed
gulldan wants to merge 1 commit into
Closed
Conversation
Address default-level clippy warnings introduced after WorksApplications#263, all in the `sudachi` crate. No API or behavior changes. - add explicit `<'_>` to return types where a lifetime is elided elsewhere in the signature (`mismatched_lifetime_syntaxes`) - drop redundant `as_bytes()` before `.len()` on `&str` - drop unneeded trailing `return` statements - prefer `sort_by_key` over `sort_by` for simple key extraction - replace `ok_or_else(|| ...)` with `ok_or(...)` when the value is trivially constructible - annotate `transmute` source/target types in `CowArray::set`, making the lifetime extension to `'a` explicit at the call site - elide unused explicit lifetime in `UserPosSupport for &mut Grammar` - remove blank line between doc comment and item in `sentence_detector` Refs WorksApplications#40
47039c8 to
c89f297
Compare
Contributor
|
Thank you for your contribution, however, as we have large diffs in |
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.
Partial fix for #40.
This fixes default-level clippy/rustc warnings introduced after #263 in the
sudachicrate only.No API or behavior changes are intended.
Fixed:
mismatched_lifetime_syntaxes: make elided lifetimes explicit on return typesneedless_as_bytesneedless_returnunnecessary_lazy_evaluationsunnecessary_sort_bymissing_transmute_annotationsneedless_lifetimesempty_line_after_doc_commentsIntentionally left out:
result_large_err&Vec/&Stringsignature changesStringNumber::to_stringrenamesudachi-fuzzunexpected_cfgs(fuzzing)python/transmute annotationsTested:
cargo fmt -- --check --files-with-diffcargo test --verbose