tree-wide: fix needless borrows

found and fixed via clippy

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-12-30 12:57:37 +01:00
parent a0c69902c8
commit 9a37bd6c84
104 changed files with 238 additions and 241 deletions

View File

@ -185,7 +185,7 @@ pub(crate) fn set_proxy_certificate(cert_pem: &[u8], key_pem: &[u8]) -> Result<(
create_configdir()?;
pbs_config::replace_backup_config(&key_path, key_pem)
.map_err(|err| format_err!("error writing certificate private key - {}", err))?;
pbs_config::replace_backup_config(&cert_path, &cert_pem)
pbs_config::replace_backup_config(&cert_path, cert_pem)
.map_err(|err| format_err!("error writing certificate file - {}", err))?;
Ok(())

View File

@ -141,7 +141,7 @@ impl NodeConfig {
/// Returns the parsed ProxyConfig
pub fn http_proxy(&self) -> Option<ProxyConfig> {
if let Some(http_proxy) = &self.http_proxy {
match ProxyConfig::parse_proxy_url(&http_proxy) {
match ProxyConfig::parse_proxy_url(http_proxy) {
Ok(proxy) => Some(proxy),
Err(_) => None,
}