Remove async-trait crate
Rust 1.75.0 has async traits 🦀🦀🦀
This commit is contained in:
3
Cargo.lock
generated
3
Cargo.lock
generated
@@ -660,10 +660,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "delfin"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"derive_builder",
|
||||
|
@@ -10,7 +10,6 @@ gst = ["dep:video_player_gst"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.75"
|
||||
async-trait = "0.1.75"
|
||||
bytes = "1.5.0"
|
||||
chrono = "0.4.31"
|
||||
derive_builder = "0.12.0"
|
||||
|
@@ -1,7 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use gtk::prelude::*;
|
||||
use jellyfin_api::types::BaseItemDto;
|
||||
use relm4::prelude::*;
|
||||
@@ -79,7 +78,6 @@ struct ViewItemsFetcher {
|
||||
view: UserView,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Fetcher for ViewItemsFetcher {
|
||||
async fn fetch(&self, start_index: usize, limit: usize) -> Result<(Vec<BaseItemDto>, usize)> {
|
||||
self.api_client
|
||||
|
@@ -1,5 +1,7 @@
|
||||
use std::{
|
||||
cmp,
|
||||
future::Future,
|
||||
marker::Send,
|
||||
sync::{
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
Arc,
|
||||
@@ -7,7 +9,6 @@ use std::{
|
||||
};
|
||||
|
||||
use anyhow::{Error, Result};
|
||||
use async_trait::async_trait;
|
||||
use jellyfin_api::types::BaseItemDto;
|
||||
use tokio::{sync::mpsc::UnboundedSender, task::JoinHandle};
|
||||
|
||||
@@ -152,9 +153,12 @@ impl<F: Fetcher + Send + Sync + 'static> MediaFetcher<F> {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait Fetcher {
|
||||
async fn fetch(&self, start_index: usize, limit: usize) -> Result<(Vec<BaseItemDto>, usize)>;
|
||||
fn fetch(
|
||||
&self,
|
||||
start_index: usize,
|
||||
limit: usize,
|
||||
) -> impl Future<Output = Result<(Vec<BaseItemDto>, usize)>> + Send;
|
||||
|
||||
fn title(&self) -> String;
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use gtk::prelude::*;
|
||||
use jellyfin_api::types::BaseItemDto;
|
||||
use relm4::{adw::traits::ActionRowExt, gtk::traits::BoxExt, prelude::*};
|
||||
@@ -101,7 +100,6 @@ struct SearchResultsFetcher {
|
||||
search_text: String,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Fetcher for SearchResultsFetcher {
|
||||
async fn fetch(&self, start_index: usize, limit: usize) -> Result<(Vec<BaseItemDto>, usize)> {
|
||||
self.api_client
|
||||
|
Reference in New Issue
Block a user