mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-16 07:52:06 +08:00
refactor(i18n): optimize translation handling with Arc<str> for better memory efficiency
refactor(tray): change menu text storage to use Arc<str> for improved performance refactor(service): utilize SmartString for error messages to enhance memory management
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use crate::utils::i18n::t;
|
||||
use smartstring::alias::String;
|
||||
use std::sync::Arc;
|
||||
|
||||
macro_rules! define_menu {
|
||||
($($field:ident => $const_name:ident, $id:expr, $text:expr),+ $(,)?) => {
|
||||
#[derive(Debug)]
|
||||
pub struct MenuTexts {
|
||||
$(pub $field: String,)+
|
||||
$(pub $field: Arc<str>,)+
|
||||
}
|
||||
|
||||
pub struct MenuIds;
|
||||
|
||||
Reference in New Issue
Block a user