mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-13 15:30:03 +00:00
Mod trait Fetcher::new
to return Arc<Self>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
0c83d010b1
commit
31b7439a69
3 changed files with 10 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
use log::info;
|
||||
use reqwest::Method;
|
||||
|
@ -17,11 +18,11 @@ pub struct QuickInstall {
|
|||
|
||||
#[async_trait::async_trait]
|
||||
impl super::Fetcher for QuickInstall {
|
||||
async fn new(data: &Data) -> Box<Self> {
|
||||
async fn new(data: &Data) -> Arc<Self> {
|
||||
let crate_name = &data.name;
|
||||
let version = &data.version;
|
||||
let target = &data.target;
|
||||
Box::new(Self {
|
||||
Arc::new(Self {
|
||||
package: format!("{crate_name}-{version}-{target}"),
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue