mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-06-14 15:40:16 +00:00
clippy fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
48efb5268d
commit
b6e7fc9bec
@ -30,7 +30,7 @@ pub fn render_epoch(value: &Value, _record: &Value) -> Result<String, Error> {
|
||||
}
|
||||
let text = match value.as_i64() {
|
||||
Some(epoch) => {
|
||||
if let Ok(epoch_string) = proxmox_time::strftime_local("%c", epoch as i64) {
|
||||
if let Ok(epoch_string) = proxmox_time::strftime_local("%c", epoch) {
|
||||
epoch_string
|
||||
} else {
|
||||
epoch.to_string()
|
||||
|
@ -1149,7 +1149,7 @@ fn rrd_update_host_stats_sync(host: &HostStats, hostdisk: &DiskStat, datastores:
|
||||
}
|
||||
|
||||
if let Some(loadavg) = &host.load {
|
||||
rrd_update_gauge("host/loadavg", loadavg.0 as f64);
|
||||
rrd_update_gauge("host/loadavg", loadavg.0);
|
||||
}
|
||||
|
||||
rrd_update_disk_stat(hostdisk, "host");
|
||||
|
@ -322,7 +322,7 @@ fn get_plugin(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error
|
||||
)]
|
||||
/// Show acme account information.
|
||||
fn add_plugin(r#type: String, core: DnsPluginCore, data: String) -> Result<(), Error> {
|
||||
let data = base64::encode(&file_get_contents(&data)?);
|
||||
let data = base64::encode(file_get_contents(data)?);
|
||||
api2::config::acme::add_plugin(r#type, core, data)?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ fn render_expire(value: &Value, _record: &Value) -> Result<String, Error> {
|
||||
let text = match value.as_i64() {
|
||||
Some(epoch) if epoch == 0 => never,
|
||||
Some(epoch) => {
|
||||
if let Ok(epoch_string) = proxmox_time::strftime_local("%c", epoch as i64) {
|
||||
if let Ok(epoch_string) = proxmox_time::strftime_local("%c", epoch) {
|
||||
epoch_string
|
||||
} else {
|
||||
epoch.to_string()
|
||||
|
@ -812,8 +812,8 @@ fn get_partitions_info(
|
||||
) -> Vec<PartitionInfo> {
|
||||
let lsblk_infos = get_lsblk_info().ok();
|
||||
partitions
|
||||
.iter()
|
||||
.map(|(_nr, disk)| {
|
||||
.values()
|
||||
.map(|disk| {
|
||||
let devpath = disk
|
||||
.device_path()
|
||||
.map(|p| p.to_owned())
|
||||
|
Loading…
Reference in New Issue
Block a user