From 6577001b957d1ac82396e86ef72709ce2b96a7f3 Mon Sep 17 00:00:00 2001 From: Koichi Akabe Date: Sun, 14 Jul 2024 13:38:59 +0900 Subject: [PATCH] Downgrade ouroboros to 0.17.2 --- examples/wasm/Cargo.toml | 2 +- examples/wasm/src/lib.rs | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index 3156717..fc1e84e 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml @@ -10,7 +10,7 @@ i18n-embed = { version = "0.14.1", features = ["fluent-system", "web-sys-request i18n-embed-fl = "0.8.0" # MIT js-sys = "0.3.69" # MIT or Apache-2.0 once_cell = "1.19.0" # MIT or Apache-2.0 -ouroboros = "0.18.4" # MIT or Apache-2.0 +ouroboros = "0.17.2" # MIT or Apache-2.0 rust-embed = "8.5.0" # MIT ruzstd = "0.7.0" # MIT serde = "1" # MIT or Apache-2.0 diff --git a/examples/wasm/src/lib.rs b/examples/wasm/src/lib.rs index 5982da4..d7481d5 100644 --- a/examples/wasm/src/lib.rs +++ b/examples/wasm/src/lib.rs @@ -3,7 +3,6 @@ pub mod i18n; pub mod text_input; pub mod token_view; -use std::borrow::Cow; use std::io::Read; use std::rc::Rc; @@ -93,20 +92,14 @@ impl Worker for VaporettoWorker { fields.sentence_orig.update_raw(msg).unwrap(); - let n_tags = fields.sentence_filtered.n_tags(); fields .sentence_orig .boundaries_mut() .copy_from_slice(fields.sentence_filtered.boundaries()); - fields.sentence_orig.reset_tags(n_tags); - for (d, s) in fields + fields .sentence_orig .tags_mut() - .iter_mut() - .zip(fields.sentence_filtered.tags()) - { - *d = s.as_ref().map(|x| Cow::Owned(x.to_string())); - } + .clone_from_slice(fields.sentence_filtered.tags()); }); let tokens = self