cargo fmt

This commit is contained in:
Ryan Heywood 2023-09-07 15:20:32 -05:00
parent aad990ab71
commit b810ab2e90
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
4 changed files with 20 additions and 9 deletions

View File

@ -45,7 +45,6 @@ pub trait PrivateKey: Sized {
fn requires_hardened_derivation() -> bool { fn requires_hardened_derivation() -> bool {
false false
} }
} }
/// Errors associated with creating and arithmetic on private keys. This specific error is only /// Errors associated with creating and arithmetic on private keys. This specific error is only

View File

@ -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 keyfork_mnemonic_util::Mnemonic;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View File

@ -73,9 +73,7 @@ where
let request: Request = match deserialize(&req) { let request: Request = match deserialize(&req) {
Ok(r) => r, Ok(r) => r,
Err(e) => { Err(e) => {
return Box::pin( return Box::pin(async move { Err(BincodeServiceError::Convert(e.to_string())) })
async move { Err(BincodeServiceError::Convert(e.to_string())) },
)
} }
}; };
@ -112,7 +110,10 @@ mod tests {
type Error = Infallible; type Error = Infallible;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>; type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;
fn poll_ready(&mut self, _cx: &mut std::task::Context<'_>) -> std::task::Poll<Result<(), Self::Error>> { fn poll_ready(
&mut self,
_cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(())) Poll::Ready(Ok(()))
} }
@ -123,11 +124,20 @@ mod tests {
#[tokio::test] #[tokio::test]
async fn can_serde_responses() { 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() let mut service = ServiceBuilder::new()
.layer(BincodeLayer::<Test>::new()) .layer(BincodeLayer::<Test>::new())
.service(App); .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); assert_eq!(result, content);
} }
} }