summaryrefslogtreecommitdiff
path: root/examples/basic.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/basic.rs
parentba865b581fbc1d0589b402b028f2bce70332891b (diff)
fix: make expectation returning method unsafe
Diffstat (limited to 'examples/basic.rs')
-rw-r--r--examples/basic.rs14
1 files changed, 8 insertions, 6 deletions
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");
}