[pdm-devel] [PATCH yew-comp 3/7] utils: factor out task description into own function

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 20 18:29:33 CET 2025


Am 20.01.25 um 10:29 schrieb Dominik Csapak:
> +/// Formats the given worker type and id to a Human readable task description
> +pub fn format_task_description(worker_type: &str, worker_id: Option<&str>) -> String {
> +    if let Some(text) = lookup_task_description(worker_type, worker_id) {
> +        text
> +    } else {
> +        match worker_id {
> +            Some(id) => format!("{} {}", worker_type, id),

nit: please inline the variables into the format string where possible and
when touching the code anyway.

> +            None => worker_type.to_string(),
>          }
>      }
>  }





More information about the pdm-devel mailing list