diff --git a/env-settings-derive/src/utils/attributes/inner.rs b/env-settings-derive/src/utils/attributes/inner.rs index 3b25776..8f56824 100644 --- a/env-settings-derive/src/utils/attributes/inner.rs +++ b/env-settings-derive/src/utils/attributes/inner.rs @@ -20,10 +20,10 @@ impl EnvSettingsInnerParams { let params = EnvSettingsInput::parse_attributes(attributes)?; let mut env_settings_inner_params = EnvSettingsInnerParams::default(); if let Some(default) = params.get("default") { - env_settings_inner_params.default = default.to_owned(); + default.clone_into(&mut env_settings_inner_params.default); } if let Some(variable) = params.get("variable") { - env_settings_inner_params.variable = variable.to_owned(); + variable.clone_into(&mut env_settings_inner_params.variable); } if params.contains_key("skip") { env_settings_inner_params.skip = true; diff --git a/env-settings-derive/src/utils/attributes/outer.rs b/env-settings-derive/src/utils/attributes/outer.rs index 680803e..5d3ea10 100644 --- a/env-settings-derive/src/utils/attributes/outer.rs +++ b/env-settings-derive/src/utils/attributes/outer.rs @@ -29,10 +29,10 @@ impl EnvSettingsOuterParams { env_settings_outer_params.delay = true; } if let Some(file_path) = params.get("file_path") { - env_settings_outer_params.file_path = file_path.to_owned(); + file_path.clone_into(&mut env_settings_outer_params.file_path); } if let Some(prefix) = params.get("prefix") { - env_settings_outer_params.prefix = prefix.to_owned(); + prefix.clone_into(&mut env_settings_outer_params.prefix); }; Ok(env_settings_outer_params) } diff --git a/env-settings-derive/src/utils/field.rs b/env-settings-derive/src/utils/field.rs index 4a7170d..0eabbc8 100644 --- a/env-settings-derive/src/utils/field.rs +++ b/env-settings-derive/src/utils/field.rs @@ -76,7 +76,7 @@ impl EnvSettingsField { let mut segments = type_path.path.segments.to_owned(); let optional_type = Self::get_optional_type(&segments); if let Some(Type::Path(optional_type_path)) = &optional_type { - segments = optional_type_path.path.segments.to_owned(); + optional_type_path.path.segments.clone_into(&mut segments); } let type_label = segments .into_iter()