From e43486367bffe755baee542f4592df781e618a28 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Sun, 28 Mar 2021 16:46:15 +0200 Subject: [PATCH] import: Switch to tokio channels --- import/Cargo.toml | 2 +- import/src/error.rs | 4 ++-- import/src/session.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/import/Cargo.toml b/import/Cargo.toml index e24d9c8..2319ce4 100644 --- a/import/Cargo.toml +++ b/import/Cargo.toml @@ -5,7 +5,6 @@ edition = "2018" [dependencies] base64 = "0.13.0" -futures-channel = "0.3.5" glib = { git = "https://github.com/gtk-rs/gtk-rs/", features = ["v2_64"] } gstreamer = "0.16.5" gstreamer-pbutils = "0.16.5" @@ -14,3 +13,4 @@ once_cell = "1.5.2" rand = "0.7.3" thiserror = "1.0.23" sha2 = "0.9.3" +tokio = { version = "1.4.0", features = ["sync"] } diff --git a/import/src/error.rs b/import/src/error.rs index a1e18dd..896a327 100644 --- a/import/src/error.rs +++ b/import/src/error.rs @@ -62,8 +62,8 @@ impl Error { } } -impl From for Error { - fn from(err: futures_channel::oneshot::Canceled) -> Self { +impl From for Error { + fn from(err: tokio::sync::oneshot::error::RecvError) -> Self { Self::us(err) } } diff --git a/import/src/session.rs b/import/src/session.rs index be84f4c..27c2893 100644 --- a/import/src/session.rs +++ b/import/src/session.rs @@ -1,9 +1,9 @@ use crate::{disc, folder}; use crate::error::Result; -use futures_channel::oneshot; use std::path::PathBuf; use std::thread; use std::sync::Arc; +use tokio::sync::oneshot; /// Interface for importing audio tracks from a medium or folder. pub struct ImportSession {