From bc1e52bc38075de2476807e73a3a68eb62dd479b Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 11 Nov 2020 17:20:53 +0100 Subject: [PATCH] api: versions: rust fmt cleanups line length limit is 100 Signed-off-by: Thomas Lamprecht --- src/api2/node/apt.rs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/api2/node/apt.rs b/src/api2/node/apt.rs index 98d02318..e58bebf4 100644 --- a/src/api2/node/apt.rs +++ b/src/api2/node/apt.rs @@ -304,31 +304,19 @@ pub fn get_versions() -> Result { ); let running_kernel = nix::sys::utsname::uname().release().to_owned(); - if let Some(proxmox_backup) = pbs_packages - .iter() - .find(|pkg| pkg.package == "proxmox-backup") - { + if let Some(proxmox_backup) = pbs_packages.iter().find(|pkg| pkg.package == "proxmox-backup") { let mut proxmox_backup = proxmox_backup.clone(); proxmox_backup.extra_info = Some(format!("running kernel: {}", running_kernel)); packages.push(proxmox_backup); } else { - packages.push(unknown_package( - "proxmox-backup".into(), - Some(running_kernel), - )); + packages.push(unknown_package("proxmox-backup".into(), Some(running_kernel))); } - if let Some(pkg) = pbs_packages - .iter() - .find(|pkg| pkg.package == "proxmox-backup-server") - { - let running_version = format!( - "running version: {}.{}", - crate::api2::version::PROXMOX_PKG_VERSION, - crate::api2::version::PROXMOX_PKG_RELEASE - ); + if let Some(pkg) = pbs_packages.iter().find(|pkg| pkg.package == "proxmox-backup-server") { + let version = crate::api2::version::PROXMOX_PKG_VERSION; + let release = crate::api2::version::PROXMOX_PKG_RELEASE; let mut pkg = pkg.clone(); - pkg.extra_info = Some(running_version); + pkg.extra_info = Some(format!("running version: {}.{}", version, release)); packages.push(pkg); }