diff --git a/crates/open_jtalk/src/jpcommon.rs b/crates/open_jtalk/src/jpcommon.rs index d31ad19..7f97c50 100644 --- a/crates/open_jtalk/src/jpcommon.rs +++ b/crates/open_jtalk/src/jpcommon.rs @@ -32,6 +32,9 @@ unsafe impl resources::Resource for JpCommon { } } +// SAFETY: `Send`と対立する性質はないはず。 +unsafe impl Send for JpCommon {} + impl<'a> Iterator for JpCommonLabelFeatureIter<'a> { type Item = &'a str; fn next(&mut self) -> Option { diff --git a/crates/open_jtalk/src/mecab/mod.rs b/crates/open_jtalk/src/mecab/mod.rs index 42fb31c..5f8b81c 100644 --- a/crates/open_jtalk/src/mecab/mod.rs +++ b/crates/open_jtalk/src/mecab/mod.rs @@ -39,6 +39,9 @@ unsafe impl resources::Resource for Mecab { } } +// SAFETY: `Send`と対立する性質はないはず。 +unsafe impl Send for Mecab {} + impl Mecab { unsafe fn as_raw_ptr(&self) -> *mut open_jtalk_sys::Mecab { if self.0.is_none() { diff --git a/crates/open_jtalk/src/njd.rs b/crates/open_jtalk/src/njd.rs index 8928eb1..5dc7533 100644 --- a/crates/open_jtalk/src/njd.rs +++ b/crates/open_jtalk/src/njd.rs @@ -24,6 +24,9 @@ unsafe impl resources::Resource for Njd { } } +// SAFETY: `Send`と対立する性質はないはず。 +unsafe impl Send for Njd {} + impl Njd { pub(crate) unsafe fn as_raw_ptr(&self) -> *mut open_jtalk_sys::NJD { if self.0.is_none() {