From 690aaf4d40ef39dfb34037291d50e3a56d09b503 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 22 Aug 2021 12:11:42 -0400 Subject: [PATCH] Format webui --- src/webui.rs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/webui.rs b/src/webui.rs index 70e63fc..3fdfb0d 100644 --- a/src/webui.rs +++ b/src/webui.rs @@ -75,7 +75,7 @@ async fn initial_load(data: web::Data, _req: HttpRequest) -> impl Resp let state = AppTemplate { body: ControlTemplate { strip_tx: Some(data.strip_tx.clone()), - ..ControlTemplate::default() + ..ControlTemplate::default() } .render() .map_err(|e| { @@ -136,12 +136,26 @@ async fn start_socket( state.parameters = p; - state.strip_tx.as_ref()? + state + .strip_tx + .as_ref()? .lock() - .map_err(|_| println!("{:?}", io::Error::new(io::ErrorKind::Other, "Failed to get a lock"))) + .map_err(|_| { + println!( + "{:?}", + io::Error::new(io::ErrorKind::Other, "Failed to get a lock") + ) + }) .ok()? - .send(strip::Message::ChangePattern(state.parameters.into_pattern())) - .map_err(|_| println!("{:?}", io::Error::new(io::ErrorKind::Other, "Failed to send to channel"))) + .send(strip::Message::ChangePattern( + state.parameters.into_pattern(), + )) + .map_err(|_| { + println!( + "{:?}", + io::Error::new(io::ErrorKind::Other, "Failed to send to channel") + ) + }) .ok()?; } @@ -150,7 +164,7 @@ async fn start_socket( let actor = StateSocket { state: ControlTemplate { strip_tx: Some(data.strip_tx.clone()), - ..ControlTemplate::default() + ..ControlTemplate::default() }, live_view, };