Impl binstall_v1::Error

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-26 22:45:48 +10:00
parent 46c4d6f406
commit 461571075d
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -1,9 +1,19 @@
use std::{
fs,
io::{self, Write},
iter::IntoIterator,
path::Path,
};
use compact_str::CompactString;
use miette::Diagnostic;
use semver::Version;
use serde::{Deserialize, Serialize};
use thiserror::Error;
use url::Url;
use crate::binstall::MetaData;
use crate::FileLock;
#[derive(Debug, Serialize, Deserialize)]
pub struct Entry {
@ -65,3 +75,12 @@ impl From<super::Source> for Source {
}
}
}
#[derive(Debug, Diagnostic, Error)]
pub enum Error {
#[error(transparent)]
Io(#[from] io::Error),
#[error(transparent)]
SerdeJsonParse(#[from] serde_json::Error),
}