From 9ef2875db7ac296687750fd3d93ff7eb16fb538d Mon Sep 17 00:00:00 2001 From: Xiretza Date: Tue, 29 Aug 2023 17:07:04 +0000 Subject: [PATCH] voxygen: avoid unnecessary allocation Cow::to_string() goes through &str even for an Owned variant, Cow::into_owned() passes Owned variants through as-is. As it happens, the values here are always Owned (see comment in try_msg_ctx() implementation). --- voxygen/i18n-helpers/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voxygen/i18n-helpers/src/lib.rs b/voxygen/i18n-helpers/src/lib.rs index 5219b77482..55c9dec4ee 100644 --- a/voxygen/i18n-helpers/src/lib.rs +++ b/voxygen/i18n-helpers/src/lib.rs @@ -228,7 +228,7 @@ pub fn localize_chat_message( }) }, } - .to_string() + .into_owned() }, };