[Bug] Waterui-controls doesn't compile "error[E0507]: cannot move out of `*value` which is behind a shared reference"
Compiling waterui-controls v0.2.1
```
error[E0507]: cannot move out of `*value` which is behind a shared reference
--> /waterui-controls-0.2.1/src/slider.rs:79:48
|
79 | label: AnyView::new(text!("{:.2}", value)),
| ---------------^^^^^-
| | |
| | move occurs because `*value` has type `Binding<f64>`, which does not implement the `Copy` trait
| `*value` moved due to this method call
|
note: `nami::SignalExt::map` takes ownership of the receiver `self`, which moves `*value`
--> /nami-0.9.1/src/ext.rs:14:23
|
14 | fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
| ^^^^
help: you can `clone` the value and consume it, but this might not be your desired behavior
|
79 | label: AnyView::new(text!("{:.2}", <Binding<f64> as Clone>::clone(&value))),
| ++++++++++++++++++++++++++++++++ +
help: consider cloning the value if the performance cost is acceptable
|
79 | label: AnyView::new(text!("{:.2}", value.clone())),
| ++++++++
```
[dependencies]
waterui = {version = "0.2.1", features = ["all"]}
cargo 1.94.1 (29ea6fb6a 2026-03-24)
Thank you for your work
0 条评论