From d9746c8ab4b83ace0221029f3267a93988e2d128 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Sun, 25 Apr 2021 22:33:40 +0200 Subject: [PATCH] database: Switch to tokio channels --- database/Cargo.toml | 2 +- database/src/error.rs | 2 +- database/src/thread.rs | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/database/Cargo.toml b/database/Cargo.toml index dc68abb..16188ba 100644 --- a/database/Cargo.toml +++ b/database/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] diesel = { version = "1.4.5", features = ["sqlite"] } diesel_migrations = "1.4.0" -futures-channel = "0.3.5" rand = "0.7.3" serde = { version = "1.0.117", features = ["derive"] } serde_json = "1.0.59" thiserror = "1.0.23" +tokio = { version = "1.4.0", features = ["sync"] } uuid = { version = "0.8", features = ["v4"] } diff --git a/database/src/error.rs b/database/src/error.rs index c9c343f..5c6734d 100644 --- a/database/src/error.rs +++ b/database/src/error.rs @@ -14,7 +14,7 @@ pub enum Error { SendError(#[from] std::sync::mpsc::SendError), #[error(transparent)] - ReceiveError(#[from] futures_channel::oneshot::Canceled), + ReceiveError(#[from] tokio::sync::oneshot::error::RecvError), #[error("Database error: {0}")] Other(String), diff --git a/database/src/thread.rs b/database/src/thread.rs index 4b72578..e16b4c4 100644 --- a/database/src/thread.rs +++ b/database/src/thread.rs @@ -1,6 +1,5 @@ use super::*; -use futures_channel::oneshot; -use futures_channel::oneshot::Sender; +use tokio::sync::oneshot::{self, Sender}; use std::sync::mpsc; use std::thread;