chore: cargo fmt & geoclue docs

This commit is contained in:
Ashley Wulber 2024-02-19 11:28:20 -05:00 committed by Ashley Wulber
parent c83767c7e5
commit 8b9767f6ce
7 changed files with 199 additions and 191 deletions

View file

@ -7,19 +7,19 @@ use futures::stream::StreamExt;
use upower_dbus::UPowerProxy;
fn main() -> zbus::Result<()> {
futures::executor::block_on(async move {
let connection = zbus::Connection::system().await?;
futures::executor::block_on(async move {
let connection = zbus::Connection::system().await?;
let upower = UPowerProxy::new(&connection).await?;
let upower = UPowerProxy::new(&connection).await?;
println!("On Battery: {:?}", upower.on_battery().await);
println!("On Battery: {:?}", upower.on_battery().await);
let mut stream = upower.receive_on_battery_changed().await;
let mut stream = upower.receive_on_battery_changed().await;
while let Some(event) = stream.next().await {
eprintln!("{:?}", event.get().await);
}
while let Some(event) = stream.next().await {
eprintln!("{:?}", event.get().await);
}
Ok(())
})
Ok(())
})
}