Legacy fixes for async traits
All checks were successful
Run Tests on Code / run-tests (push) Successful in 32s
All checks were successful
Run Tests on Code / run-tests (push) Successful in 32s
This commit is contained in:
parent
affe62b973
commit
4297860b9e
4 changed files with 6 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -45,6 +45,7 @@ dependencies = [
|
||||||
name = "aob-lemmy-bot"
|
name = "aob-lemmy-bot"
|
||||||
version = "3.0.0-rc.1"
|
version = "3.0.0-rc.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"async-trait",
|
||||||
"chrono",
|
"chrono",
|
||||||
"confy",
|
"confy",
|
||||||
"lemmy_api_common",
|
"lemmy_api_common",
|
||||||
|
|
|
@ -31,4 +31,5 @@ confy = "^0.6"
|
||||||
toml = "^0.8"
|
toml = "^0.8"
|
||||||
systemd-journal-logger = "^2.1.1"
|
systemd-journal-logger = "^2.1.1"
|
||||||
log = "^0.4"
|
log = "^0.4"
|
||||||
|
async-trait = "^0.1"
|
||||||
notify = "6.1.1"
|
notify = "6.1.1"
|
|
@ -3,6 +3,7 @@ use chrono::{DateTime, Duration, Utc};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ops::Sub;
|
use std::ops::Sub;
|
||||||
|
use async_trait::async_trait;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use crate::fetchers::{FetcherTrait};
|
use crate::fetchers::{FetcherTrait};
|
||||||
use crate::lemmy::{PartInfo, PostInfo, PostInfoInner, PostType};
|
use crate::lemmy::{PartInfo, PostInfo, PostInfoInner, PostType};
|
||||||
|
@ -104,6 +105,7 @@ impl JNovelFetcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
impl FetcherTrait for JNovelFetcher {
|
impl FetcherTrait for JNovelFetcher {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
JNovelFetcher {
|
JNovelFetcher {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
use async_trait::async_trait;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use strum_macros::Display;
|
use strum_macros::Display;
|
||||||
use crate::fetchers::Fetcher::Jnc;
|
use crate::fetchers::Fetcher::Jnc;
|
||||||
|
@ -6,6 +7,7 @@ use crate::lemmy::{PostInfo};
|
||||||
|
|
||||||
pub mod jnovel;
|
pub mod jnovel;
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
pub(crate) trait FetcherTrait {
|
pub(crate) trait FetcherTrait {
|
||||||
fn new() -> Self where Self: Sized;
|
fn new() -> Self where Self: Sized;
|
||||||
async fn check_feed(&self) -> Result<Vec<PostInfo>, ()>;
|
async fn check_feed(&self) -> Result<Vec<PostInfo>, ()>;
|
||||||
|
|
Loading…
Reference in a new issue