refactor: better value cloning
This commit is contained in:
+1
-1
@@ -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 {
|
||||
|
||||
+5
-5
@@ -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<poem::listener::TcpListener<String>>,
|
||||
) -> 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.
|
||||
|
||||
Reference in New Issue
Block a user