Make fetcher creating infallible

That in turns means that every fetcher error is caught properly.
This commit is contained in:
Félix Saparelli 2022-04-27 22:41:28 +12:00
parent 6db14362ac
commit 4a1b79bc40
5 changed files with 48 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> {