diff --git a/src/i18n.rs b/src/i18n.rs index a223b27..d779ee8 100644 --- a/src/i18n.rs +++ b/src/i18n.rs @@ -149,7 +149,7 @@ pub fn order_languages( language_order: &[unic_langid::LanguageIdentifier], eq: impl Fn(&T, &unic_langid::LanguageIdentifier) -> bool, ) -> Vec { - let mut ordered = Vec::new(); + let mut ordered = Vec::with_capacity(unordered.len()); for l in language_order { if let Some(i) = unordered.iter().position(|t| eq(t, l)) { ordered.push(unordered.remove(i));