From cf11c160962aa44cee37f71d3615b6b2aac7aebd Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Mon, 9 Feb 2026 21:25:19 +0100 Subject: [PATCH] [fix](trx-ft8): make decoder Send Co-authored-by: Codex Signed-off-by: Stanislaw Grams --- src/trx-ft8/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/trx-ft8/src/lib.rs b/src/trx-ft8/src/lib.rs index d63c65f..9e02d29 100644 --- a/src/trx-ft8/src/lib.rs +++ b/src/trx-ft8/src/lib.rs @@ -50,6 +50,10 @@ pub struct Ft8Decoder { sample_rate: u32, } +// SAFETY: Ft8Decoder owns its C-side state and is not shared across threads. +// It is only moved into a single task, so Send is safe. +unsafe impl Send for Ft8Decoder {} + impl Ft8Decoder { pub fn new(sample_rate: u32) -> Result { unsafe { @@ -112,7 +116,7 @@ impl Ft8Decoder { let count = count.max(0) as usize; let mut out = Vec::with_capacity(count); for item in raw.into_iter().take(count) { - let text = unsafe { CStr::from_ptr(item.text.as_ptr()) } + let text = CStr::from_ptr(item.text.as_ptr()) .to_string_lossy() .to_string(); out.push(Ft8DecodeResult {