Make fetcher creating infallible (#118)

Fixes #109
This commit is contained in:
Félix Saparelli 2022-04-29 09:24:46 +12:00 committed by GitHub
parent 62ec23e6f4
commit 1757dc5344
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 33 deletions

View file

@ -16,13 +16,13 @@ pub struct QuickInstall {
#[async_trait::async_trait]
impl super::Fetcher for QuickInstall {
async fn new(data: &Data) -> Result<Box<Self>, anyhow::Error> {
async fn new(data: &Data) -> Box<Self> {
let crate_name = &data.name;
let version = &data.version;
let target = &data.target;
Ok(Box::new(Self {
Box::new(Self {
package: format!("{crate_name}-{version}-{target}"),
}))
})
}
async fn check(&self) -> Result<bool, anyhow::Error> {