api: versions: rust fmt cleanups

line length limit is 100

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-11-11 17:20:53 +01:00
parent 6f0073bbb5
commit bc1e52bc38
1 changed files with 6 additions and 18 deletions

View File

@ -304,31 +304,19 @@ pub fn get_versions() -> Result<Value, Error> {
); );
let running_kernel = nix::sys::utsname::uname().release().to_owned(); let running_kernel = nix::sys::utsname::uname().release().to_owned();
if let Some(proxmox_backup) = pbs_packages if let Some(proxmox_backup) = pbs_packages.iter().find(|pkg| pkg.package == "proxmox-backup") {
.iter()
.find(|pkg| pkg.package == "proxmox-backup")
{
let mut proxmox_backup = proxmox_backup.clone(); let mut proxmox_backup = proxmox_backup.clone();
proxmox_backup.extra_info = Some(format!("running kernel: {}", running_kernel)); proxmox_backup.extra_info = Some(format!("running kernel: {}", running_kernel));
packages.push(proxmox_backup); packages.push(proxmox_backup);
} else { } else {
packages.push(unknown_package( packages.push(unknown_package("proxmox-backup".into(), Some(running_kernel)));
"proxmox-backup".into(),
Some(running_kernel),
));
} }
if let Some(pkg) = pbs_packages if let Some(pkg) = pbs_packages.iter().find(|pkg| pkg.package == "proxmox-backup-server") {
.iter() let version = crate::api2::version::PROXMOX_PKG_VERSION;
.find(|pkg| pkg.package == "proxmox-backup-server") let release = crate::api2::version::PROXMOX_PKG_RELEASE;
{
let running_version = format!(
"running version: {}.{}",
crate::api2::version::PROXMOX_PKG_VERSION,
crate::api2::version::PROXMOX_PKG_RELEASE
);
let mut pkg = pkg.clone(); let mut pkg = pkg.clone();
pkg.extra_info = Some(running_version); pkg.extra_info = Some(format!("running version: {}.{}", version, release));
packages.push(pkg); packages.push(pkg);
} }