From 426b531e4cd42f1fa95210d1901fccd19f7719c1 Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Sun, 26 Dec 2021 00:07:34 +0100 Subject: [PATCH] fmt --- src/builder.rs | 8 ++++++-- src/locator.rs | 5 ++++- src/resources/mod.rs | 23 ++++++++++++++--------- src/templates/php.rs | 5 ++++- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 8cfa7e7..831a42e 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -33,7 +33,9 @@ use crate::symbols::wordpress::{ Plugin as WordpressPluginSymbol, Translation as WordpressTranslationSymbol, }; use crate::templates::nginx; -use crate::templates::php::{fpm_pool_config as php_fpm_pool_config, FpmPoolConfig as PhpFpmPoolConfig}; +use crate::templates::php::{ + fpm_pool_config as php_fpm_pool_config, FpmPoolConfig as PhpFpmPoolConfig, +}; use crate::templates::systemd::{ nodejs_service as systemd_nodejs_service, socket_service as systemd_socket_service, }; @@ -250,7 +252,9 @@ impl + Clone + Display> ImplementationBuilder> for } } -impl, C: Clone + Into> ImplementationBuilder> for DefaultBuilder { +impl, C: Clone + Into> + ImplementationBuilder> for DefaultBuilder +{ type Prerequisites = ( PhpFpmPool, CertChain, diff --git a/src/locator.rs b/src/locator.rs index 6633d4e..2b0561c 100644 --- a/src/locator.rs +++ b/src/locator.rs @@ -302,7 +302,10 @@ impl, P, C, POLICY> ResourceLocator> for Defaul type Prerequisites = (); fn locate( resource: &ServePhp, - ) -> ( as Resource>::Artifact, Self::Prerequisites) { + ) -> ( + as Resource>::Artifact, + Self::Prerequisites, + ) { ( PathArtifact::from(Path::new("/etc/nginx/sites-enabled/").join(&resource.0)), (), diff --git a/src/resources/mod.rs b/src/resources/mod.rs index d8837f5..9b16405 100644 --- a/src/resources/mod.rs +++ b/src/resources/mod.rs @@ -147,13 +147,7 @@ impl Resource for ServeCustom { } #[derive(Debug, Hash, PartialEq, Eq)] -pub struct ServePhp( - pub D, - pub P, - pub &'static str, - pub String, - pub C, -); +pub struct ServePhp(pub D, pub P, pub &'static str, pub String, pub C); impl Resource for ServePhp { type Artifact = PathArtifact; } @@ -319,7 +313,18 @@ default_resources!( WordpressTranslation: WordpressTranslation, ); -pub fn serve_php, C: Into>(domain: D, path: P, root_filename: &'static str, nginx_config: impl Into, pool_config: C) -> ServePhp { +pub fn serve_php, C: Into>( + domain: D, + path: P, + root_filename: &'static str, + nginx_config: impl Into, + pool_config: C, +) -> ServePhp { ServePhp( - domain, path.into(), root_filename, nginx_config.into(), pool_config.into()) + domain, + path.into(), + root_filename, + nginx_config.into(), + pool_config.into(), + ) } diff --git a/src/templates/php.rs b/src/templates/php.rs index d131fe2..7bd7695 100644 --- a/src/templates/php.rs +++ b/src/templates/php.rs @@ -27,7 +27,10 @@ impl From for FpmPoolConfig { impl FpmPoolConfig { pub fn new(max_children: usize, custom: impl Into) -> Self { - Self { max_children, custom: Some(custom.into()) } + Self { + max_children, + custom: Some(custom.into()), + } } }