summaryrefslogtreecommitdiff
path: root/examples/generic_trait.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/generic_trait.rs')
-rw-r--r--examples/generic_trait.rs16
1 files changed, 10 insertions, 6 deletions
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);