Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error: lifetime may not live long enough
- --> src\funcs\mod.rs:59:49
- |
- 59 | .try_filter(async move |device| {
- | _________________________________________-------_^
- | | | |
- | | | return type of closure `[async closure body@src\funcs\mod.rs:59:49: 62:18]` contains a lifetime `'2`
- | | has type `&'1 brightness::BrightnessDevice`
- 60 | | let devname: Result<String, brightness::Error> = device.device_name().await;
- 61 | | devname.is_ok_and(|devname| device_names.contains(&devname)) // bool
- 62 | | })
- | |_________________^ returning this value requires that `'1` must outlive `'2`
- error[E0507]: cannot move out of `device_names`, a captured variable in an `FnMut` closure
- --> src\funcs\mod.rs:59:49
- |
- 53 | device_names: Arc<HashSet<String>>,
- | ------------ captured outer variable
- ...
- 59 | .try_filter(async move |device| {
- | _____________________________-------------------_^
- | | |
- | | captured by this `FnMut` closure
- 60 | | let devname: Result<String, brightness::Error> = device.device_name().await;
- 61 | | devname.is_ok_and(|devname| device_names.contains(&devname)) // bool
- | | ------------
- | | |
- | | variable moved due to use in generator
- | | move occurs because `device_names` has type `Arc<HashSet<std::string::String>>`, which does not implement the `Copy` trait
- 62 | | })
- | |_________________^ `device_names` is moved here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement