diff --git a/src/route/mod.rs b/src/route/mod.rs index 6efe248..0a716d6 100644 --- a/src/route/mod.rs +++ b/src/route/mod.rs @@ -29,7 +29,7 @@ pub(crate) struct Api { impl From<&Settings> for Api { fn from(value: &Settings) -> Self { - let contact = contact::ContactApi::from(value.clone().email); + let contact = contact::ContactApi::from(value.email.clone()); let health = health::HealthApi; let meta = meta::MetaApi::from(&value.application); Self { diff --git a/src/startup.rs b/src/startup.rs index 48bc821..03d9538 100644 --- a/src/startup.rs +++ b/src/startup.rs @@ -108,8 +108,8 @@ impl Application { Self::prevent_unencrypted_smtp_with_credentials(settings); let api_service = OpenApiService::new( Api::from(settings).apis(), - settings.application.clone().name, - settings.application.clone().version, + settings.application.name.clone(), + settings.application.version.clone(), ) .url_prefix("/api"); let ui = api_service.swagger_ui(); @@ -156,7 +156,7 @@ impl Application { tcp_listener: Option>, ) -> Self { let port = settings.application.port; - let host = settings.application.clone().host; + let host = settings.application.host.clone(); let app = Self::setup_app(&settings); let server = Self::setup_server(&settings, tcp_listener); Self { @@ -176,8 +176,8 @@ impl Application { /// Returns the host address the application is configured to bind to. #[must_use] - pub fn host(&self) -> String { - self.host.clone() + pub fn host(&self) -> &str { + &self.host } /// Returns the port the application is configured to bind to.