我正在 Rust 中测试自定义双向迭代器,但遇到了错误
error[E0382]: borrow of moved value: `iter`
--> src/main.rs:40:13
|
37 | let mut iter = BiIterator::from(vec![1, 2, 3]);
| -------- move occurs because `iter` has type `BiIterator<i32>`, which does not implement the `Copy` trait
38 | for i in iter {
| ----
| |
| `iter` moved due to this implicit call to `.into_iter()`
| help: consider borrowing to avoid moving into the for loop: `&iter`
39 | if i == 3 {
40 | iter.position(0); …Run Code Online (Sandbox Code Playgroud) 有没有办法从用户提供的 Rust 中的 &str 类型获取函数指针。示例: use 提供了用户提供的函数名称我需要某种方式来调用该函数,最好是闭包或函数指针