Skip to content

Commit

Permalink
Don't generic unneeded GenericExpectation code
Browse files Browse the repository at this point in the history
We had been generating it, but not calling it, for non-generic methods
of generic structs.
  • Loading branch information
asomers committed Nov 3, 2020
1 parent 9586b50 commit 4b6013c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mockall_derive/src/mock_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,9 @@ impl<'a> ToTokens for GenericExpectations<'a> {
if ! self.f.is_expectation_generic() {
return;
}
if ! self.f.is_static() && ! self.f.is_method_generic() {
return;
}

let ge = StaticGenericExpectations{f: self.f};
let v = &self.f.privmod_vis;
Expand Down

0 comments on commit 4b6013c

Please sign in to comment.