Mod trait Fetcher::new to return Arc<Self>

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-07 15:16:10 +10:00
parent 0c83d010b1
commit 31b7439a69
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
3 changed files with 10 additions and 7 deletions

View file

@ -1,4 +1,5 @@
use std::path::Path;
use std::sync::Arc;
use log::{debug, info, warn};
use reqwest::Method;
@ -22,8 +23,8 @@ impl GhCrateMeta {
#[async_trait::async_trait]
impl super::Fetcher for GhCrateMeta {
async fn new(data: &Data) -> Box<Self> {
Box::new(Self { data: data.clone() })
async fn new(data: &Data) -> Arc<Self> {
Arc::new(Self { data: data.clone() })
}
async fn check(&self) -> Result<bool, BinstallError> {