Skip to content

Commit

Permalink
fix: fix infinite loops
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Oct 28, 2024
1 parent 6eb6202 commit 2c37b51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Binary file modified bindings/wasm/bin/decancer.wasm
Binary file not shown.
8 changes: 7 additions & 1 deletion core/src/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ impl FromIterator<Translation> for String {
where
I: IntoIterator<Item = Translation>,
{
iter.into_iter().collect()
let iter = iter.into_iter();
let (size_hint, _) = iter.size_hint();

let mut s = String::with_capacity(size_hint);
s.extend(iter);

s
}
}

Expand Down

0 comments on commit 2c37b51

Please sign in to comment.