We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8ed0a8 commit ba72789Copy full SHA for ba72789
examples/reflection/function_reflection.rs
@@ -68,13 +68,6 @@ fn main() {
68
dbg!(increment_function.call_once(args).unwrap());
69
assert_eq!(count, 5);
70
71
- // All closures must be `'static`— that is, they take full ownership of any captured variables.
72
- let add_closure = |left: i32, right: i32| -> i32 { left + right };
73
- let mut count_function = dbg!(add_closure.into_function());
74
- let args = dbg!(ArgList::new().push_owned(2_i32).push_owned(2_i32));
75
- let value = dbg!(count_function.call(args).unwrap()).unwrap_owned();
76
- assert_eq!(value.take::<i32>().unwrap(), 4);
77
-
78
// As stated before, this works for many kinds of simple functions.
79
// Functions with non-reflectable arguments or return values may not be able to be converted.
80
// Generic functions are also not supported.
0 commit comments