tree-wide: replace serde_json::from_value(a_value.clone())

`&Value` itself implements `Deserializer` and can therefore
be passed directly to `T::deserialize` without requiring an
intermediate `clone()`. (This also enables optionally
borrowing strings if the result has a short enough lifetime)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2022-04-12 12:39:50 +02:00
committed by Thomas Lamprecht
parent 845baef61b
commit 38774184a9
8 changed files with 12 additions and 10 deletions

View File

@ -706,7 +706,7 @@ pub fn update_plugin(
bail!("cannot update plugin of type {:?}", ty);
}
let mut plugin: DnsPlugin = serde_json::from_value(entry.clone())?;
let mut plugin = DnsPlugin::deserialize(&*entry)?;
if let Some(delete) = delete {
for delete_prop in delete {