refactor: standardize on .to_owned() for message in linters#3569
Open
hippietrail wants to merge 7 commits into
Open
refactor: standardize on .to_owned() for message in linters#3569hippietrail wants to merge 7 commits into
.to_owned() for message in linters#3569hippietrail wants to merge 7 commits into
Conversation
…wned_for_linter_messages # Conflicts: # harper-core/src/linting/repeated_words.rs
…ndardize_on_to_owned_for_linter_messages
…/github.com/hippietrail/harper into standardize_on_to_owned_for_linter_messages
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.
Issues
N/A
Description
I was looking into handling a false positive in a linter I didn't write and noticed it used
.to_owned()on the literal string set as the linter'smessagewhereas I'd been using.to_string()in all of mine.I asked an AI and it said in old versions of rust
.to_owned()was faster but these days they're the same. But it still said that if I were to standardize on what that.to_owned()would be the better choice.Some other calls to
.to_string()on string literals also got changed by the search-and-replace I used but none resulted in errors or warnings so I let them be.How Has This Been Tested?
cargo testAI Disclosure
I used Google Search's AI.
Checklist