From 3aaf3bd8426dcc374e60468558b34d1333c41a77 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 6 Mar 2024 23:47:53 -0800 Subject: [PATCH] refactor: use allegedly more performant codium fix --- client/src-tauri/src/telemetry/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src-tauri/src/telemetry/mod.rs b/client/src-tauri/src/telemetry/mod.rs index 0c6b588..98a597c 100644 --- a/client/src-tauri/src/telemetry/mod.rs +++ b/client/src-tauri/src/telemetry/mod.rs @@ -55,7 +55,8 @@ pub async fn subscribe_topics( /// This function strips the '/SmartDashboard/' prefix from the topic name if /// it is present. This allows easier data processing from the frontend. fn process_message(message: &mut MessageData) { - if let Some(stripped) = message.topic_name.strip_prefix("/SmartDashboard/") { - message.topic_name = stripped.to_string(); - } + message.topic_name = message + .topic_name + .trim_start_matches("/SmartDashboard/") + .to_string(); }