diff --git a/src/lib.rs b/src/lib.rs index 7f7245c..ad9355e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,8 +14,8 @@ pub mod question; pub mod record; pub mod service_store; pub mod stats; -pub mod tls; pub mod system_dns; +pub mod tls; pub type Error = Box; pub type Result = std::result::Result; diff --git a/src/main.rs b/src/main.rs index eafdc3d..9c1a543 100644 --- a/src/main.rs +++ b/src/main.rs @@ -152,7 +152,10 @@ async fn main() -> numa::Result<()> { if config.blocking.enabled { format!("{} lists", config.blocking.lists.len()) } else { "disabled".to_string() }); if config.proxy.enabled { let schemes = if config.proxy.tls_port > 0 { - format!("http://:{} https://:{}", config.proxy.port, config.proxy.tls_port) + format!( + "http://:{} https://:{}", + config.proxy.port, config.proxy.tls_port + ) } else { format!("http://*.{} on :{}", config.proxy.tld, config.proxy.port) }; diff --git a/src/proxy.rs b/src/proxy.rs index 546c8bb..787bbf9 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -43,10 +43,7 @@ pub async fn start_proxy(ctx: Arc, port: u16) { .http1_preserve_header_case(true) .build_http(); - let state = ProxyState { - ctx, - client, - }; + let state = ProxyState { ctx, client }; let app = Router::new().fallback(any(proxy_handler)).with_state(state); @@ -72,10 +69,7 @@ pub async fn start_proxy_tls(ctx: Arc, port: u16, tls_config: Arc, req: Request) -> axum::r None => { return ( StatusCode::BAD_GATEWAY, - format!("unknown service: {}{}", service_name, state.ctx.proxy_tld_suffix), + format!( + "unknown service: {}{}", + service_name, state.ctx.proxy_tld_suffix + ), ) .into_response() } diff --git a/src/service_store.rs b/src/service_store.rs index 411e69d..26b2daf 100644 --- a/src/service_store.rs +++ b/src/service_store.rs @@ -95,7 +95,10 @@ impl ServiceStore { } } if count > 0 { - info!("loaded {} persisted services from {:?}", count, self.persist_path); + info!( + "loaded {} persisted services from {:?}", + count, self.persist_path + ); } } Err(e) => warn!("failed to parse {:?}: {}", self.persist_path, e), diff --git a/src/tls.rs b/src/tls.rs index fd9f656..5fdada5 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -28,7 +28,11 @@ pub fn build_tls_config(tld: &str, service_names: &[String]) -> crate::Result