heim
heim copied to clipboard
Can't use `sensors::temperatures` function in different thread
If the sensors::temperatures
function is spawned into a different thread, it fails with implementation of `std::ops::FnOnce` is not general enough
.
MWE:
use futures::StreamExt;
use heim::sensors;
#[tokio::main]
async fn main() {
tokio::spawn(async {
sensors::temperatures()
.collect::<Vec<Result<sensors::TemperatureSensor, heim::Error>>>()
.await
});
}