gardesk/garcalc / 7f48608

Browse files

Apply formatting cleanup across app entrypoints

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
7f4860831704cb428c12804e973cedad582b7251
Parents
68f2023
Tree
48a5f82

5 changed files

StatusFile+-
M garcalc/src/config.rs 5 2
M garcalc/src/ipc.rs 3 5
M garcalc/src/main.rs 1 1
M garcalcctl/src/main.rs 3 3
M garcas/src/main.rs 4 2
garcalc/src/config.rsmodified
@@ -153,9 +153,12 @@ impl Config {
153153
                 let config = Self::from_lua_table(&calc)?;
154154
                 Ok(config)
155155
             } else {
156
-                Err(mlua::Error::RuntimeError("gar.calculator not found".to_string()))
156
+                Err(mlua::Error::RuntimeError(
157
+                    "gar.calculator not found".to_string(),
158
+                ))
157159
             }
158
-        }).map_err(|e| anyhow::anyhow!("Lua error: {}", e))
160
+        })
161
+        .map_err(|e| anyhow::anyhow!("Lua error: {}", e))
159162
     }
160163
 
161164
     /// Parse Config from Lua table
garcalc/src/ipc.rsmodified
@@ -1,11 +1,11 @@
11
 //! IPC server for garcalc daemon
22
 
3
-use std::sync::atomic::{AtomicBool, Ordering};
43
 use std::sync::Arc;
4
+use std::sync::atomic::{AtomicBool, Ordering};
55
 
66
 use anyhow::Result;
77
 use garcalc_cas::Evaluator;
8
-use garcalc_ipc::{socket_path, Command, Mode, Response, ResponseData};
8
+use garcalc_ipc::{Command, Mode, Response, ResponseData, socket_path};
99
 use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
1010
 use tokio::net::{UnixListener, UnixStream};
1111
 use tokio::signal;
@@ -142,9 +142,7 @@ impl IpcServer {
142142
                 }
143143
                 Err(e) => Response::err(e.to_string()),
144144
             },
145
-            Command::GetMode => {
146
-                Response::ok_with_data(ResponseData::Mode { mode: self.mode })
147
-            }
145
+            Command::GetMode => Response::ok_with_data(ResponseData::Mode { mode: self.mode }),
148146
             Command::SetMode { mode } => {
149147
                 self.mode = mode;
150148
                 Response::ok()
garcalc/src/main.rsmodified
@@ -10,7 +10,7 @@ mod ui;
1010
 
1111
 use anyhow::Result;
1212
 use clap::Parser;
13
-use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
13
+use tracing_subscriber::{EnvFilter, layer::SubscriberExt, util::SubscriberInitExt};
1414
 
1515
 #[derive(Parser, Debug)]
1616
 #[command(name = "garcalc")]
garcalcctl/src/main.rsmodified
@@ -7,7 +7,7 @@ use std::os::unix::net::UnixStream;
77
 
88
 use anyhow::{Context, Result};
99
 use clap::{Parser, Subcommand};
10
-use garcalc_ipc::{socket_path, Command, Mode, Response};
10
+use garcalc_ipc::{Command, Mode, Response, socket_path};
1111
 
1212
 #[derive(Parser)]
1313
 #[command(name = "garcalcctl")]
@@ -98,8 +98,8 @@ fn send_command(command: &Command) -> Result<Response> {
9898
     let mut response_line = String::new();
9999
     reader.read_line(&mut response_line)?;
100100
 
101
-    let response: Response = serde_json::from_str(&response_line)
102
-        .context("Failed to parse response from garcalc")?;
101
+    let response: Response =
102
+        serde_json::from_str(&response_line).context("Failed to parse response from garcalc")?;
103103
 
104104
     Ok(response)
105105
 }
garcas/src/main.rsmodified
@@ -11,7 +11,7 @@ use std::io::{self, BufRead, Write};
1111
 
1212
 use anyhow::{Context, Result};
1313
 use clap::Parser;
14
-use garcalc_cas::{eval::AngleMode, Evaluator};
14
+use garcalc_cas::{Evaluator, eval::AngleMode};
1515
 use tracing_subscriber::EnvFilter;
1616
 
1717
 #[derive(Parser)]
@@ -38,7 +38,9 @@ struct Args {
3838
 
3939
 fn main() -> Result<()> {
4040
     tracing_subscriber::fmt()
41
-        .with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("warn")))
41
+        .with_env_filter(
42
+            EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("warn")),
43
+        )
4244
         .init();
4345
 
4446
     let args = Args::parse();