Conversation
Most of these are calling clone when the struct supports Copy. Many are using & and &mut on `self` when the function they are called from already has an immutable or mutable borrow so this isn't needed. I tried to stay away from actual changes or places where I'd have to name fresh variables.
Hello @ehiggs thanks for your PR! bors try |
tryBuild succeeded: |
Glad to help! @ManyTheFish let me know if there are any changes or explanations needed. |
@ehiggs thanks for your PR. The team has a lot to do currently because of our sprint + hacktoberfest. We will do our best to review your PR asap 😄 Thanks again for your work, this is really appreciated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @ehiggs, I approve this PR because there is no issue here and your work is really valuable, thanks for this. 👍
However, it changes a significant amount of files and I'm a bit concerned by the merge conflicts that people will have. 🤔
@ManyTheFish what is the best solution then? Which PRs can be problematic? |
How do I set a label like "no breaking" for the Enforce PR labels? |
I understand the concern, which is why I only did some of the fixes. If someone needs help with rebasing, let me know and I can help. |
I think we can merge this PR, bors merge |
Build succeeded: |
This message is sent automatically Thank you for contributing to Meilisearch. If you are participating in Hacktoberfest, and you would like to receive some gift from Meilisearch too, please complete this form. |
668: Fix many Clippy errors part 2 r=ManyTheFish a=ehiggs This brings us a step closer to enforcing clippy on each build. # Pull Request ## Related issue This does not fix any issue outright, but it is a second round of fixes for clippy after #665. This should contribute to fixing #659. ## What does this PR do? Satisfies many issues for clippy. The complaints are mostly: * Passing reference where a variable is already a reference. * Using clone where a struct already implements `Copy` * Using `ok_or_else` when it is a closure that returns a value instead of using the closure to call function (hence we use `ok_or`) * Unambiguous lifetimes don't need names, so we can just use `'_` * Using `return` when it is not needed as we are on the last expression of a function. ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Ewan Higgs <ewan.higgs@gmail.com>
Related issue
No issue fixed. Simply cleaning up some code for clippy on the march towards a clean build when #659 is merged.
What does this PR do?
Most of these are calling clone when the struct supports Copy.
Many are using & and &mut on
self
when the function they are called from already has an immutable or mutable borrow so this isn't needed.I tried to stay away from actual changes or places where I'd have to name fresh variables.
PR checklist
Please check if your PR fulfills the following requirements: