Repository navigation
breaking: remove redundant MockExt trait - #285
Merged
alexliesenfeld merged 4 commits intoSep 3, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
danieleades
marked this pull request as ready for review
August 12, 2026 19:25
danieleades
force-pushed
the
agent/clippy-new-ret-no-self
branch
4 times, most recently
from
August 16, 2026 12:41
7f6946b to
0f62600
Compare
danieleades
force-pushed
the
agent/clippy-new-ret-no-self
branch
from
August 17, 2026 18:50
0f62600 to
6d02436
Compare
Contributor
Author
|
@FalkWoldmann this is good to go, despite the CI failure (it's unrelated). I'm seeing a lot of flaky tests- some kind of race condition / filename collision? Is there a tracking issue for this already? |
5 of 15 tasks
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.
What changed
MockExttraitMock::new(id, &server)constructorMock::id()and make theidfield privateclippy::new_ret_no_selffrom the temporary allow listWhy
The duplication came from two 2021 changes that were later combined. One added
MockRefExtto expose reconstruction and ID access, the other independently addedMockRef::newand made the ID public. Once both landed there were two ways to build a mock handle, one inherent and one through an extension trait.Mockshould own its constructor and ID accessor. Dropping the trait leaves one way to do it, puts the field back behind an accessor, and lets Clippy catch futurenewmethods that return something other thanSelf.Breaking changes
MockExtimports, trait bounds and implementations need removingmock.idbecomesmock.id()Mock::new(id, &server)Runtime behavior is unchanged.
Validation
cargo +stable clippy --all-targets --all-featurescargo +stable test --all-features --libcargo +stable fmt --all -- --checkgit diff --check