Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Jan 20, 2025
1 parent 907101f commit f77f7f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions native/src/dynamic/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ mod tests {
*y = x;
}

fn wrap<T>(x: T) -> RefCell<Box<dyn Any>> {
Box::new(x).into()
fn wrap<T: 'static>(x: T) -> RefCell<Box<dyn Any>> {
RefCell::new(Box::new(x))
}

#[test]
Expand All @@ -133,7 +133,7 @@ mod tests {
fn call_dynamic_function() {
assert_eq!(
*foo.into_dynamic()
.call(&[&wrap(1usize), &wrap(2usize)], &[])
.call(&[&wrap(1usize), &wrap(2usize)])
.unwrap()
.downcast::<usize>()
.unwrap(),
Expand All @@ -145,7 +145,7 @@ mod tests {
fn call_dynamic_function_with_mutable_reference() {
let x: RefCell<Box<dyn Any>> = RefCell::new(Box::new(0usize));

baz.into_dynamic().call(&[&42usize], &[&x]).unwrap();
baz.into_dynamic().call(&[&wrap(42usize), &x]).unwrap();

assert_eq!(*x.borrow().downcast_ref::<usize>().unwrap(), 42);
}
Expand Down

0 comments on commit f77f7f6

Please sign in to comment.