remove use of deprecated functions from proxmox-time

Depend on proxmox-time 1.1.1

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-11-30 13:12:09 +01:00
committed by Dietmar Maurer
parent ad72fda1d6
commit 68b6c1202c
8 changed files with 17 additions and 19 deletions

View File

@ -19,7 +19,7 @@ serde = { version = "1.0", features = ["derive"] }
proxmox-lang = "1.0.0"
proxmox-schema = { version = "1.0.1", features = [ "api-macro" ] }
proxmox-serde = "0.1"
proxmox-time = "1.1"
proxmox-time = "1.1.1"
proxmox-uuid = { version = "1.0.0", features = [ "serde" ] }
proxmox-sys = "0.2" # only needed for nodename()??

View File

@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
use proxmox_schema::{api, Schema, StringSchema, ApiStringFormat, Updater};
use proxmox_time::{parse_calendar_event, parse_time_span, CalendarEvent, TimeSpan};
use proxmox_time::{CalendarEvent, TimeSpan};
use crate::{
PROXMOX_SAFE_ID_FORMAT,
@ -62,7 +62,7 @@ impl std::str::FromStr for MediaSetPolicy {
return Ok(MediaSetPolicy::AlwaysCreate);
}
let event = parse_calendar_event(s)?;
let event = s.parse()?;
Ok(MediaSetPolicy::CreateAt(event))
}
@ -97,7 +97,7 @@ impl std::str::FromStr for RetentionPolicy {
return Ok(RetentionPolicy::KeepForever);
}
let time_span = parse_time_span(s)?;
let time_span = s.parse()?;
Ok(RetentionPolicy::ProtectFor(time_span))
}