Fmt: Added cargofmt config and reformatted files
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-11-20 23:27:48 +01:00
parent 78bb80d510
commit 73a2b077ed
28 changed files with 141 additions and 204 deletions

View File

@@ -1,13 +1,11 @@
use async_trait::async_trait;
use serde::Serialize;
use crate::{
errors::{DeviceError, ErrorCode},
request::execute::CommandType,
response,
traits::{FanSpeed, OnOff, Scene, Trait},
types::Type,
};
use crate::errors::{DeviceError, ErrorCode};
use crate::request::execute::CommandType;
use crate::response;
use crate::traits::{FanSpeed, OnOff, Scene, Trait};
use crate::types::Type;
// TODO: Find a more elegant way to do this
pub trait AsGoogleHomeDevice {

View File

@@ -1,15 +1,14 @@
use std::{collections::HashMap, sync::Arc};
use std::collections::HashMap;
use std::sync::Arc;
use futures::future::{join_all, OptionFuture};
use thiserror::Error;
use tokio::sync::{Mutex, RwLock};
use crate::{
device::AsGoogleHomeDevice,
errors::{DeviceError, ErrorCode},
request::{self, Intent, Request},
response::{self, execute, query, sync, Response, ResponsePayload, State},
};
use crate::device::AsGoogleHomeDevice;
use crate::errors::{DeviceError, ErrorCode};
use crate::request::{self, Intent, Request};
use crate::response::{self, execute, query, sync, Response, ResponsePayload, State};
#[derive(Debug)]
pub struct GoogleHome {

View File

@@ -13,7 +13,6 @@ pub mod traits;
pub mod types;
pub use device::GoogleHomeDevice;
pub use fullfillment::FullfillmentError;
pub use fullfillment::GoogleHome;
pub use fullfillment::{FullfillmentError, GoogleHome};
pub use request::Request;
pub use response::Response;

View File

@@ -1,6 +1,7 @@
use serde::Serialize;
use crate::{errors::ErrorCode, response::State};
use crate::errors::ErrorCode;
use crate::response::State;
#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
@@ -87,10 +88,8 @@ pub enum Status {
#[cfg(test)]
mod tests {
use super::*;
use crate::{
errors::DeviceError,
response::{Response, ResponsePayload, State},
};
use crate::errors::DeviceError;
use crate::response::{Response, ResponsePayload, State};
#[test]
fn serialize() {

View File

@@ -2,7 +2,8 @@ use std::collections::HashMap;
use serde::Serialize;
use crate::{errors::ErrorCode, response::State};
use crate::errors::ErrorCode;
use crate::response::State;
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]

View File

@@ -69,11 +69,9 @@ impl Device {
#[cfg(test)]
mod tests {
use super::*;
use crate::{
response::{Response, ResponsePayload},
traits::Trait,
types::Type,
};
use crate::response::{Response, ResponsePayload};
use crate::traits::Trait;
use crate::types::Type;
#[test]
fn serialize() {