From 98baaed81c8ba624adadbf9b12d21c0844ab1de2 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 25 Aug 2023 04:28:47 -0500 Subject: [PATCH] cargo fmt --- keyfork-derive-util/src/lib.rs | 3 +-- keyfork-frame/src/lib.rs | 2 +- keyforkd/src/server.rs | 13 +++++++++---- keyforkd/src/service.rs | 13 +++++++------ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/keyfork-derive-util/src/lib.rs b/keyfork-derive-util/src/lib.rs index 5d48502..83382e1 100644 --- a/keyfork-derive-util/src/lib.rs +++ b/keyfork-derive-util/src/lib.rs @@ -1,4 +1,4 @@ -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug)] pub struct DerivablePath { @@ -21,4 +21,3 @@ impl DerivablePath { } } */ - diff --git a/keyfork-frame/src/lib.rs b/keyfork-frame/src/lib.rs index f83d09b..476db18 100644 --- a/keyfork-frame/src/lib.rs +++ b/keyfork-frame/src/lib.rs @@ -116,7 +116,7 @@ pub fn try_decode(data: &[u8]) -> Result, DecodeError> { #[cfg(test)] mod tests { - use super::{try_encode, try_decode, DecodeError}; + use super::{try_decode, try_encode, DecodeError}; #[test] fn stable_interface() { diff --git a/keyforkd/src/server.rs b/keyforkd/src/server.rs index a0ac667..87dfddd 100644 --- a/keyforkd/src/server.rs +++ b/keyforkd/src/server.rs @@ -1,7 +1,10 @@ use crate::service::{DerivationError, Keyforkd}; -use keyfork_frame::asyncext::{try_decode_from, try_encode_to}; use keyfork_derive_util::DerivablePath; -use std::{io::Error, path::{Path, PathBuf}}; +use keyfork_frame::asyncext::{try_decode_from, try_encode_to}; +use std::{ + io::Error, + path::{Path, PathBuf}, +}; use tokio::net::{UnixListener, UnixStream}; use tower::{Service, ServiceExt}; @@ -32,7 +35,10 @@ impl UnixServer { tokio::spawn(async move { let result = tokio::signal::ctrl_c().await; #[cfg(feature = "tracing")] - debug!(?result, "encountered ctrl-c, performing cleanup and exiting"); + debug!( + ?result, + "encountered ctrl-c, performing cleanup and exiting" + ); let result = tokio::fs::remove_file(&path).await; #[cfg(feature = "tracing")] if let Err(error) = result { @@ -87,7 +93,6 @@ impl UnixServer { #[cfg(feature = "tracing")] debug!(%e, "Error sending response to client"); } - }); } } diff --git a/keyforkd/src/service.rs b/keyforkd/src/service.rs index 1e6b3fa..f0de0fd 100644 --- a/keyforkd/src/service.rs +++ b/keyforkd/src/service.rs @@ -1,9 +1,9 @@ -use std::{future::Future, pin::Pin, task::Poll, sync::Arc}; +use std::{future::Future, pin::Pin, sync::Arc, task::Poll}; -use keyfork_mnemonic_util::Mnemonic; use keyfork_derive_util::DerivablePath; -use tower::Service; +use keyfork_mnemonic_util::Mnemonic; use thiserror::Error; +use tower::Service; #[derive(Clone, Debug)] pub struct Keyforkd { @@ -12,12 +12,13 @@ pub struct Keyforkd { // Currently, this can't be instantiated, therefore it is a never-type #[derive(Debug, Error)] -pub enum DerivationError { -} +pub enum DerivationError {} impl Keyforkd { pub fn new(mnemonic: Mnemonic) -> Self { - Self { mnemonic: Arc::new(mnemonic) } + Self { + mnemonic: Arc::new(mnemonic), + } } }