Skip to content

A fast, helpful, and open-source document parser

fix: impl Send + Sync on OcrEngine also for wasm-32 target so that it can be safely sent between threads

Clelia (Astra) Bertelli602cc14bfacd
diff --git a/crates/liteparse/src/ocr/mod.rs b/crates/liteparse/src/ocr/mod.rs
index 3e280ee..43f8efd 100644
--- a/crates/liteparse/src/ocr/mod.rs
+++ b/crates/liteparse/src/ocr/mod.rs
@@ -43,7 +43,7 @@ pub trait OcrEngine: Send + Sync {
}
#[cfg(target_arch = "wasm32")]
-pub trait OcrEngine {
+pub trait OcrEngine: Send + Sync {
fn name(&self) -> &str;
fn recognize<'a, 'b: 'a, 'c: 'a>(
&'a self,
diff --git a/crates/liteparse/src/parser.rs b/crates/liteparse/src/parser.rs
index 6d4899b..dadc62a 100644
--- a/crates/liteparse/src/parser.rs
+++ b/crates/liteparse/src/parser.rs
@@ -180,7 +180,6 @@ impl LiteParse {
#[cfg(test)]
mod tests {
use super::*;
- use crate::types::ParsedPage;
#[test]
#[allow(clippy::field_reassign_with_default)]