Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsafe impl Send for {Mecab,Njd,JpCommon} #31

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/open_jtalk/src/jpcommon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::Item> {
Expand Down
3 changes: 3 additions & 0 deletions crates/open_jtalk/src/mecab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions crates/open_jtalk/src/njd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading