cargo fmt

This commit is contained in:
Ryan Heywood 2023-08-25 04:28:47 -05:00
parent da96ea94bd
commit 98baaed81c
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
4 changed files with 18 additions and 13 deletions

View File

@ -1,4 +1,4 @@
use serde::{Serialize, Deserialize}; use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Serialize, Deserialize, Clone, Debug)]
pub struct DerivablePath { pub struct DerivablePath {
@ -21,4 +21,3 @@ impl DerivablePath {
} }
} }
*/ */

View File

@ -116,7 +116,7 @@ pub fn try_decode(data: &[u8]) -> Result<Vec<u8>, DecodeError> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::{try_encode, try_decode, DecodeError}; use super::{try_decode, try_encode, DecodeError};
#[test] #[test]
fn stable_interface() { fn stable_interface() {

View File

@ -1,7 +1,10 @@
use crate::service::{DerivationError, Keyforkd}; use crate::service::{DerivationError, Keyforkd};
use keyfork_frame::asyncext::{try_decode_from, try_encode_to};
use keyfork_derive_util::DerivablePath; 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 tokio::net::{UnixListener, UnixStream};
use tower::{Service, ServiceExt}; use tower::{Service, ServiceExt};
@ -32,7 +35,10 @@ impl UnixServer {
tokio::spawn(async move { tokio::spawn(async move {
let result = tokio::signal::ctrl_c().await; let result = tokio::signal::ctrl_c().await;
#[cfg(feature = "tracing")] #[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; let result = tokio::fs::remove_file(&path).await;
#[cfg(feature = "tracing")] #[cfg(feature = "tracing")]
if let Err(error) = result { if let Err(error) = result {
@ -87,7 +93,6 @@ impl UnixServer {
#[cfg(feature = "tracing")] #[cfg(feature = "tracing")]
debug!(%e, "Error sending response to client"); debug!(%e, "Error sending response to client");
} }
}); });
} }
} }

View File

@ -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 keyfork_derive_util::DerivablePath;
use tower::Service; use keyfork_mnemonic_util::Mnemonic;
use thiserror::Error; use thiserror::Error;
use tower::Service;
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Keyforkd { pub struct Keyforkd {
@ -12,12 +12,13 @@ pub struct Keyforkd {
// Currently, this can't be instantiated, therefore it is a never-type // Currently, this can't be instantiated, therefore it is a never-type
#[derive(Debug, Error)] #[derive(Debug, Error)]
pub enum DerivationError { pub enum DerivationError {}
}
impl Keyforkd { impl Keyforkd {
pub fn new(mnemonic: Mnemonic) -> Self { pub fn new(mnemonic: Mnemonic) -> Self {
Self { mnemonic: Arc::new(mnemonic) } Self {
mnemonic: Arc::new(mnemonic),
}
} }
} }