From 2864e1984a79ebfe7801538b70381911dc18e84c Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 29 Apr 2025 23:27:43 +0800 Subject: [PATCH] improve cap --- src/client.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/client.rs b/src/client.rs index 3c3850d0a..0019bb975 100644 --- a/src/client.rs +++ b/src/client.rs @@ -2318,16 +2318,21 @@ impl LoginConfigHandler { display_name = crate::username(); } let display_name = display_name - .chars() - .enumerate() - .map(|(i, c)| { - if i == 0 { - c.to_uppercase().to_string() - } else { - c.to_string() - } + .split_whitespace() + .map(|word| { + word.chars() + .enumerate() + .map(|(i, c)| { + if i == 0 { + c.to_uppercase().to_string() + } else { + c.to_string() + } + }) + .collect::() }) - .collect::(); + .collect::>() + .join(" "); #[cfg(not(target_os = "android"))] let my_platform = whoami::platform().to_string(); #[cfg(target_os = "android")]