server: change status of a task from a string to an enum
representing a state via an enum makes more sense in this case we also implement FromStr and Display to make it easy to convet from/to a string Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
df30017ff8
commit
4c116bafb8
@ -595,7 +595,7 @@ impl From<crate::server::TaskListInfo> for TaskListItem {
|
||||
fn from(info: crate::server::TaskListInfo) -> Self {
|
||||
let (endtime, status) = info
|
||||
.state
|
||||
.map_or_else(|| (None, None), |(a,b)| (Some(a), Some(b)));
|
||||
.map_or_else(|| (None, None), |(a,b)| (Some(a), Some(b.to_string())));
|
||||
|
||||
TaskListItem {
|
||||
upid: info.upid_str,
|
||||
|
Reference in New Issue
Block a user