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 authored and Thomas Lamprecht committed 2022-04-12 16:12:15 +02:00
1 parent 845baef61b
commit 38774184a9
8 files changed
+12 -10

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ pub(crate) fn get_acme_plugin(
Ok(Some(match ty.as_str() {
"dns" => {
let plugin: DnsPlugin = serde_json::from_value(data.clone())?;
let plugin: DnsPlugin = serde::Deserialize::deserialize(data)?;
Box::new(plugin)
}
"standalone" => {