mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 22:30:03 +00:00
Improve fmt::Display
impl for all Error types (#781)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
9d9b72c768
commit
d9dd611b9e
6 changed files with 17 additions and 17 deletions
|
@ -31,10 +31,10 @@ const BUFFER_SIZE: usize = 4096 * 5;
|
|||
#[derive(Debug, Diagnostic, Error)]
|
||||
#[non_exhaustive]
|
||||
pub enum Error {
|
||||
#[error(transparent)]
|
||||
#[error("I/O Error: {0}")]
|
||||
Io(#[from] io::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
#[error("Failed to parse json: {0}")]
|
||||
SerdeJsonParse(#[from] serde_json::Error),
|
||||
}
|
||||
|
||||
|
|
|
@ -181,13 +181,13 @@ impl CratesToml<'_> {
|
|||
#[derive(Debug, Diagnostic, Error)]
|
||||
#[non_exhaustive]
|
||||
pub enum CratesTomlParseError {
|
||||
#[error(transparent)]
|
||||
#[error("I/O Error: {0}")]
|
||||
Io(#[from] io::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
#[error("Failed to deserialize toml: {0}")]
|
||||
TomlParse(Box<toml_edit::de::Error>),
|
||||
|
||||
#[error(transparent)]
|
||||
#[error("Failed to serialie toml: {0}")]
|
||||
TomlWrite(Box<toml_edit::ser::Error>),
|
||||
|
||||
#[error(transparent)]
|
||||
|
|
|
@ -98,10 +98,10 @@ impl FromStr for CrateVersionSource {
|
|||
#[derive(Debug, Diagnostic, Error)]
|
||||
#[non_exhaustive]
|
||||
pub enum CvsParseError {
|
||||
#[error(transparent)]
|
||||
#[error("Failed to parse url in cvs: {0}")]
|
||||
UrlParse(#[from] url::ParseError),
|
||||
|
||||
#[error(transparent)]
|
||||
#[error("Failed to parse version in cvs: {0}")]
|
||||
VersionParse(#[from] semver::Error),
|
||||
|
||||
#[error("unknown source type {kind}+{arg}")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue