From 8735719ecc8b02765132b88e15082f097c1f568c Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Thu, 8 Dec 2022 16:15:45 +0100 Subject: [PATCH] radicle: Remove unused error variants Signed-off-by: Alexis Sellier --- radicle/src/identity/project.rs | 10 ---------- radicle/src/storage/git.rs | 10 +++------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/radicle/src/identity/project.rs b/radicle/src/identity/project.rs index 1f369e74..cd76822f 100644 --- a/radicle/src/identity/project.rs +++ b/radicle/src/identity/project.rs @@ -2,7 +2,6 @@ mod id; use std::collections::{BTreeMap, HashMap}; use std::fmt::{self, Write as _}; -use std::io; use std::marker::PhantomData; use std::ops::Deref; use std::path::Path; @@ -42,27 +41,18 @@ pub const MAX_DELEGATES: usize = 255; pub enum DocError { #[error("json: {0}")] Json(#[from] serde_json::Error), - #[error("i/o: {0}")] - Io(#[from] io::Error), - #[error("verification: {0}")] - Verification(#[from] VerificationError), - #[error("payload: {0}")] - Payload(#[from] PayloadError), #[error("git: {0}")] Git(#[from] git::Error), #[error("git: {0}")] RawGit(#[from] git2::Error), #[error("storage: {0}")] Storage(#[from] storage::Error), - #[error("git: reference `{0}` was not found")] - NotFound(git::RefString), } impl DocError { /// Whether this error is caused by the document not being found. pub fn is_not_found(&self) -> bool { match self { - Self::NotFound(_) => true, Self::Git(git::Error::NotFound(_)) => true, Self::Git(git::Error::Git(e)) if git::is_not_found_err(e) => true, _ => false, diff --git a/radicle/src/storage/git.rs b/radicle/src/storage/git.rs index dd2823d5..d6cee07a 100644 --- a/radicle/src/storage/git.rs +++ b/radicle/src/storage/git.rs @@ -11,7 +11,7 @@ use radicle_cob::{self as cob, change}; use crate::git; use crate::identity; -use crate::identity::project::{Identity, IdentityError, Project}; +use crate::identity::project::{Identity, IdentityError, Project, VerificationError}; use crate::identity::{Doc, Id}; use crate::storage::refs; use crate::storage::refs::{Refs, SignedRefs}; @@ -43,8 +43,8 @@ pub enum ProjectError { Doc(#[from] identity::project::DocError), #[error("payload error: {0}")] Payload(#[from] identity::project::PayloadError), - #[error("identity verification error: {0}")] - Verify(#[from] identity::project::VerificationError), + #[error("verification error: {0}")] + Verification(#[from] VerificationError), #[error("git: {0}")] Git(#[from] git2::Error), #[error("git: {0}")] @@ -176,12 +176,8 @@ pub enum VerifyError { InvalidRemote(RemoteId), #[error("invalid target `{2}` for reference `{1}` of remote `{0}`")] InvalidRefTarget(RemoteId, RefString, git2::Oid), - #[error("invalid reference")] - InvalidRef, #[error("invalid identity: {0}")] InvalidIdentity(#[from] IdentityError), - #[error("ref error: {0}")] - Ref(#[from] git::RefError), #[error("refs error: {0}")] Refs(#[from] refs::Error), #[error("unknown reference `{1}` in remote `{0}`")]