On Mon, Jul 17, 2023 at 05:00:16PM +0200, Lukas Wagner wrote:
> Signed-off-by: Lukas Wagner <l.wag...@proxmox.com>
> ---
>  pve-rs/src/notify.rs | 33 ++++++++++++++++++++++++++++++++-
>  1 file changed, 32 insertions(+), 1 deletion(-)
> 
> diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs
> index ea34bfe..04e902c 100644
> --- a/pve-rs/src/notify.rs
> +++ b/pve-rs/src/notify.rs
> @@ -34,6 +34,14 @@ fn lookup_mail_address(content: &str, user: &str) -> 
> Option<String> {
>      }))
>  }
>  
> +fn lookup_datacenter_config_key(content: &str, key: &str) -> Option<String> {
> +    normalize_for_return(
> +        content
> +            .lines()
> +            .find_map(|line| line.strip_prefix(&format!("{key}:"))),

nit: you could format!() first then `move |...|` it into the closure so
it doesn't get recreated on every closure invocation.

> +    )
> +}
> +
>  struct PVEContext;
>  
>  impl Context for PVEContext {


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to