Remove needsless cloning of objects

This commit is contained in:
Linus Färnstrand 2025-03-18 10:20:45 +01:00
parent d076d81486
commit 31308e7e05
4 changed files with 4 additions and 5 deletions

View File

@ -405,7 +405,7 @@ impl UpdateContext {
async move {
log::debug!("Writing version check cache to {}", cache_path.display());
let cached_app_version = CachedAppVersionInfo::from(last_app_version.to_owned());
let cached_app_version = CachedAppVersionInfo::from(last_app_version);
let buf = serde_json::to_vec_pretty(&cached_app_version).map_err(Error::Serialize)?;
tokio::fs::write(cache_path, buf)
.await

View File

@ -278,7 +278,7 @@ impl Platform {
let new_release = format::Release {
changelog: changes.to_owned(),
version: version.clone(),
installers: installers.to_owned(),
installers,
rollout,
};

View File

@ -446,7 +446,7 @@ impl SplitTunnel {
error.display_chain_with_msg("Failed to update path monitor")
);
}
*monitored_paths_guard = paths.to_vec();
*monitored_paths_guard = paths;
}
result

View File

@ -261,7 +261,6 @@ impl SystemdResolved {
}
pub fn set_dns(&self, interface_index: u32, servers: Vec<IpAddr>) -> Result<DnsState> {
let set_servers = servers.to_vec();
let link_object_path = self
.fetch_link(interface_index)
.map_err(|e| Error::GetLinkError(Box::new(e)))?;
@ -269,7 +268,7 @@ impl SystemdResolved {
Ok(DnsState {
interface_path: link_object_path,
interface_index,
set_servers,
set_servers: servers,
})
}