diff options
author | HampusM <hampus@hampusmat.com> | 2023-03-26 17:39:27 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-03-26 17:39:27 +0200 |
commit | 1628732d6514670fe2108e5063e9d5ba7166ad94 (patch) | |
tree | 4e54f68ed3869b8b50adceba6e8c95b3db53d41e /examples/automock.rs | |
parent | 7f9294869afd07e096e73a45e6a101b8970a0e6e (diff) |
fix: replace Self in generics
Diffstat (limited to 'examples/automock.rs')
-rw-r--r-- | examples/automock.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/automock.rs b/examples/automock.rs index c8725ce..a597678 100644 --- a/examples/automock.rs +++ b/examples/automock.rs @@ -3,14 +3,22 @@ use ridicule::predicate::{always, eq}; use crate::cool_trais::MockFoo; +pub trait DoStuff<Thing> {} + +impl<TFoo: Foo> DoStuff<TFoo> for f32 {} + mod cool_trais { use ridicule::automock; + use crate::DoStuff; + #[automock] - pub trait Foo + pub trait Foo: Sized { - fn bar<Something>(&self, num: u128, text: &str) -> Something; + fn bar<Something>(&self, num: u128, text: &str) -> Something + where + Something: DoStuff<Self>; } } |