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/basic.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'examples/basic.rs') diff --git a/examples/basic.rs b/examples/basic.rs index 01688f5..189b45a 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -19,12 +19,14 @@ 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}'"); - }); + unsafe { + mock_foo + .expect_bar() + .with(eq(1234), always()) + .returning(|_, num, text| { + println!("bar was called with {num} and '{text}'"); + }); + } mock_foo.bar(1234, "Hello"); } -- cgit v1.2.3-18-g5258