diff options
| -rw-r--r-- | server/src/trans.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/src/trans.rs b/server/src/trans.rs index 64e08de..bbf0600 100644 --- a/server/src/trans.rs +++ b/server/src/trans.rs @@ -9,7 +9,7 @@ use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::{BufReader, Read}; -use std::iter::{repeat, IntoIterator}; +use std::iter::IntoIterator; use std::path::Path; use tokio::task::JoinSet; @@ -112,10 +112,9 @@ fn push_translation( unit: grit::TranslationUnit, ) { let mut translation = String::new(); - let mut placeholder_offset = Vec::<usize>::with_capacity(string.placeholders.len()); // Fill offset vec with zeros, it's not guaranteed that they will be in the same order // below so easier to index directly. - placeholder_offset.extend(repeat(0).take(string.placeholders.len())); + let mut placeholder_offset = vec![0; string.placeholders.len()]; // There can be multiple placeholders with the same name, so when doing name lookup, // skip the previous hits. |
