summaryrefslogtreecommitdiff
path: root/examples/generic_trait.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-04-01 15:27:09 +0200
committerHampusM <hampus@hampusmat.com>2023-04-01 15:27:09 +0200
commit5eb823896f01146df0d4ed6c296ef7dd445ccbbf (patch)
tree482ba87a3977f646dcff956affd47dac50a2d647 /examples/generic_trait.rs
parentba865b581fbc1d0589b402b028f2bce70332891b (diff)
fix: make expectation returning method unsafe
Diffstat (limited to 'examples/generic_trait.rs')
-rw-r--r--examples/generic_trait.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/examples/generic_trait.rs b/examples/generic_trait.rs
index d863d85..b821f43 100644
--- a/examples/generic_trait.rs
+++ b/examples/generic_trait.rs
@@ -20,13 +20,17 @@ fn main()
{
let mut mock_foo = MockFoo::new();
- mock_foo.expect_bar().returning(|_me, something: &f32| {
- println!("bar was called with {something}");
- });
+ unsafe {
+ mock_foo.expect_bar().returning(|_me, something: &f32| {
+ println!("bar was called with {something}");
+ });
+ }
- mock_foo.expect_bar().returning(|_me, something: &f64| {
- println!("bar was called with {something}");
- });
+ unsafe {
+ mock_foo.expect_bar().returning(|_me, something: &f64| {
+ println!("bar was called with {something}");
+ });
+ }
mock_foo.bar(&0.826f32);