block_in_place in transcoder
This commit is contained in:
parent
0ad014a544
commit
0b98540e35
@ -120,14 +120,12 @@ async fn transcoder_task(
|
||||
encoding_to: EncodingRef,
|
||||
) {
|
||||
while let Some(FileData { name, data }) = rx.recv().await {
|
||||
let new_data = task::spawn_blocking(move || {
|
||||
let new_data = task::block_in_place(move || {
|
||||
let text = encoding_from.decode(&data, DecoderTrap::Ignore).unwrap();
|
||||
encoding_to
|
||||
.encode(text.as_str(), EncoderTrap::Ignore)
|
||||
.unwrap()
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
});
|
||||
|
||||
tx.send(FileData {
|
||||
name,
|
||||
|
Loading…
Reference in New Issue
Block a user