From f43322d841338ea1f8a3a678bbbe014002b4fef8 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Thu, 21 Oct 2021 17:01:39 +0200 Subject: [PATCH] format --- src/bridge.rs | 8 ++++++-- src/lib.rs | 13 ++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/bridge.rs b/src/bridge.rs index 9132747..b97d640 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -2,7 +2,10 @@ use std::{collections::HashMap, sync::Arc}; use crate::api::{ internal::{RegisterReq, RegisterResponse, RegisterSuccess}, - ApiError, Group, Light, UpdateStatus, + ApiError, + Group, + Light, + UpdateStatus, }; use miette::Diagnostic; use reqwest::Client; @@ -50,7 +53,8 @@ impl ActionStatus { } impl Bridge { - /// tries to register a new user at the given bridge endpoint with a given username. + /// tries to register a new user at the given bridge endpoint with a given + /// username. pub async fn register( http: Arc, devicetype: &str, diff --git a/src/lib.rs b/src/lib.rs index d088de9..8633e13 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ -use std::sync::Arc; use miette::Diagnostic; -use std::{io, time::Duration}; +use std::{io, sync::Arc, time::Duration}; use thiserror::Error; use tokio_stream::StreamExt; use url::Url; @@ -24,8 +23,9 @@ pub enum DiscoverError { } /// Looks for hue bridges in the local network using the SSDP protocol. -/// A reqwest client is required, to fetch the device's description, which is needed to make sure a -/// device is a hue bridge. If a bridge is found, it's URL is returned. +/// A reqwest client is required, to fetch the device's description, which is +/// needed to make sure a device is a hue bridge. If a bridge is found, it's URL +/// is returned. pub async fn discover_bridge( reqwest_client: Arc, timeout: Duration, @@ -38,8 +38,8 @@ pub async fn discover_bridge( if resp.location().ends_with("/description.xml") { let mut url = Url::parse(resp.location())?; - // this check is needed so we don't think that all devices that use description.xml are - // hue bridges. + // this check is needed so we don't think that all devices that use + // description.xml are hue bridges. if reqwest_client .get(url.clone()) .send() @@ -64,4 +64,3 @@ pub enum Error { #[error("JSON error")] JsonError(#[from] serde_json::Error), } -