From 5eb823896f01146df0d4ed6c296ef7dd445ccbbf Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 1 Apr 2023 15:27:09 +0200 Subject: fix: make expectation returning method unsafe --- examples/generic_trait.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'examples/generic_trait.rs') 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); -- cgit v1.2.3-18-g5258