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/automock.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'examples/automock.rs') diff --git a/examples/automock.rs b/examples/automock.rs index a597678..a0d638a 100644 --- a/examples/automock.rs +++ b/examples/automock.rs @@ -26,14 +26,16 @@ fn main() { let mut mock_foo = MockFoo::new(); - mock_foo - .expect_bar() - .with(eq(1234), always()) - .returning(|_, num, text| { - println!("bar was called with {num} and '{text}'"); - - 9.36f32 - }); + unsafe { + mock_foo + .expect_bar() + .with(eq(1234), always()) + .returning(|_, num, text| { + println!("bar was called with {num} and '{text}'"); + + 9.36f32 + }); + } mock_foo.bar::(1234, "Hello"); } -- cgit v1.2.3-18-g5258