From b1e5359bf34fba4392634f7a7ec43964b53f96a4 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 2 Apr 2023 20:41:34 +0200 Subject: docs: fix the mock macro example --- macros/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 13037e4..8783838 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -63,9 +63,11 @@ mod util; /// { /// let mut mock_foo = MockFoo::new(); /// -/// mock_foo -/// .expect_bar() -/// .returning(|foo, a: u32| format!("Hello {a}")); +/// unsafe { +/// mock_foo +/// .expect_bar() +/// .returning(|foo, a: u32| format!("Hello {a}")); +/// } /// /// assert_eq!(mock_foo.bar::(123), "Hello 123"); /// } -- cgit v1.2.3-18-g5258