From b810ab2e90e3030f0a37614aba2796a2a69cba2c Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 7 Sep 2023 15:20:32 -0500 Subject: [PATCH] cargo fmt --- keyfork-derive-util/src/private_key.rs | 1 - keyfork-derive-util/src/request.rs | 4 +++- keyfork-mnemonic-util/src/lib.rs | 2 +- keyforkd/src/middleware.rs | 22 ++++++++++++++++------ 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/keyfork-derive-util/src/private_key.rs b/keyfork-derive-util/src/private_key.rs index 9bf7769..d985e07 100644 --- a/keyfork-derive-util/src/private_key.rs +++ b/keyfork-derive-util/src/private_key.rs @@ -45,7 +45,6 @@ pub trait PrivateKey: Sized { fn requires_hardened_derivation() -> bool { false } - } /// Errors associated with creating and arithmetic on private keys. This specific error is only diff --git a/keyfork-derive-util/src/request.rs b/keyfork-derive-util/src/request.rs index bad236b..7ec84e4 100644 --- a/keyfork-derive-util/src/request.rs +++ b/keyfork-derive-util/src/request.rs @@ -1,4 +1,6 @@ -use crate::{extended_key::private_key::Error as XPrvError, DerivationPath, ExtendedPrivateKey, PrivateKey}; +use crate::{ + extended_key::private_key::Error as XPrvError, DerivationPath, ExtendedPrivateKey, PrivateKey, +}; use keyfork_mnemonic_util::Mnemonic; use serde::{Deserialize, Serialize}; diff --git a/keyfork-mnemonic-util/src/lib.rs b/keyfork-mnemonic-util/src/lib.rs index 017e00f..0229321 100644 --- a/keyfork-mnemonic-util/src/lib.rs +++ b/keyfork-mnemonic-util/src/lib.rs @@ -214,7 +214,7 @@ impl Mnemonic { } num }) - .collect::>() + .collect::>() } #[must_use] diff --git a/keyforkd/src/middleware.rs b/keyforkd/src/middleware.rs index b102689..b8b7b59 100644 --- a/keyforkd/src/middleware.rs +++ b/keyforkd/src/middleware.rs @@ -73,9 +73,7 @@ where let request: Request = match deserialize(&req) { Ok(r) => r, Err(e) => { - return Box::pin( - async move { Err(BincodeServiceError::Convert(e.to_string())) }, - ) + return Box::pin(async move { Err(BincodeServiceError::Convert(e.to_string())) }) } }; @@ -112,7 +110,10 @@ mod tests { type Error = Infallible; type Future = Pin> + Send>>; - fn poll_ready(&mut self, _cx: &mut std::task::Context<'_>) -> std::task::Poll> { + fn poll_ready( + &mut self, + _cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { Poll::Ready(Ok(())) } @@ -123,11 +124,20 @@ mod tests { #[tokio::test] async fn can_serde_responses() { - let content = serialize(&Test { field: "hello world!".to_string() }).unwrap(); + let content = serialize(&Test { + field: "hello world!".to_string(), + }) + .unwrap(); let mut service = ServiceBuilder::new() .layer(BincodeLayer::::new()) .service(App); - let result = service.ready().await.unwrap().call(content.clone()).await.unwrap(); + let result = service + .ready() + .await + .unwrap() + .call(content.clone()) + .await + .unwrap(); assert_eq!(result, content); } }