chore: fmt

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2023-08-27 19:57:22 +02:00
parent 86cfc18076
commit d3beab5006
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
6 changed files with 670 additions and 521 deletions

View File

@ -1,16 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
use axum::async_trait;
use churn_domain::ServerEnrollReq;
use axum::{async_trait};
use churn_domain::{ServerEnrollReq};
use tokio::sync::Mutex; use tokio::sync::Mutex;
@ -37,8 +28,6 @@ struct DefaultAgentService {
leases: Arc<Mutex<Vec<String>>>, leases: Arc<Mutex<Vec<String>>>,
} }
#[async_trait] #[async_trait]
pub trait AgentServiceTrait { pub trait AgentServiceTrait {
async fn enroll(&self, agent_name: &str, server: &str, lease: &str) -> anyhow::Result<()>; async fn enroll(&self, agent_name: &str, server: &str, lease: &str) -> anyhow::Result<()>;

View File

@ -42,14 +42,11 @@ enum Commands {
}, },
} }
#[derive(Clone)] #[derive(Clone, Default)]
#[derive(Default)]
struct AppState { struct AppState {
agent: AgentService, agent: AgentService,
} }
#[tokio::main] #[tokio::main]
async fn main() -> anyhow::Result<()> { async fn main() -> anyhow::Result<()> {
dotenv::dotenv().ok(); dotenv::dotenv().ok();

View File

@ -2,7 +2,7 @@ use capnp::message::{Builder, HeapAllocator};
use capnp::message::{ReaderOptions, TypedReader}; use capnp::message::{ReaderOptions, TypedReader};
use capnp::serialize::{self, SliceSegments}; use capnp::serialize::{self, SliceSegments};
use capnp::traits::{Owned}; use capnp::traits::Owned;
use churn_domain::{Agent, LogEvent}; use churn_domain::{Agent, LogEvent};
mod models_capnp; mod models_capnp;
@ -14,7 +14,6 @@ pub trait CapnpPackExt {
fn deserialize_capnp(content: &Vec<u8>) -> anyhow::Result<Self::Return>; fn deserialize_capnp(content: &Vec<u8>) -> anyhow::Result<Self::Return>;
fn capnp_to_string(builder: &Builder<HeapAllocator>) -> Vec<u8> { fn capnp_to_string(builder: &Builder<HeapAllocator>) -> Vec<u8> {
serialize::write_message_to_words(builder) serialize::write_message_to_words(builder)
} }
@ -26,8 +25,6 @@ pub trait CapnpPackExt {
serialize::read_message_from_flat_slice(&mut content.as_slice(), ReaderOptions::new()) serialize::read_message_from_flat_slice(&mut content.as_slice(), ReaderOptions::new())
.unwrap(); .unwrap();
log_event.into_typed::<S>() log_event.into_typed::<S>()
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,10 @@
use core::slice::SlicePattern; use core::slice::SlicePattern;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait; use async_trait::async_trait;
#[derive(Clone)] #[derive(Clone)]
pub struct Db(Arc<dyn DbTrait + Send + Sync + 'static>); pub struct Db(Arc<dyn DbTrait + Send + Sync + 'static>);

View File

@ -1,16 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use axum::async_trait;
use axum::{async_trait};
use tokio::sync::Mutex; use tokio::sync::Mutex;
@ -36,8 +26,6 @@ struct DefaultLeaseService {
leases: Arc<Mutex<Vec<String>>>, leases: Arc<Mutex<Vec<String>>>,
} }
#[async_trait] #[async_trait]
pub trait LeaseServiceTrait { pub trait LeaseServiceTrait {
async fn create_lease(&self) -> anyhow::Result<String>; async fn create_lease(&self) -> anyhow::Result<String>;