From b00eb0ce64f6d8f78bd017ac575341c885ed12a0 Mon Sep 17 00:00:00 2001 From: Eduardo Trujillo <ed@chromabits.com> Date: Sun, 19 May 2024 21:26:45 +0000 Subject: [PATCH] refactor: Remove unused error variants revealed by thiserror migration --- src/files/path.rs | 4 ---- src/files/service.rs | 16 ---------------- 2 files changed, 20 deletions(-) diff --git a/src/files/path.rs b/src/files/path.rs index 0328037..fd9adcf 100644 --- a/src/files/path.rs +++ b/src/files/path.rs @@ -10,16 +10,12 @@ pub enum PathError { }, #[error("Path has no parent")] NoParent, - #[error("Path is relative")] - RelativePath, #[error("Unable to canonicalize path (Path: {}, Source: {})", path.display(), source)] Canonicalize { path: PathBuf, #[source] source: std::io::Error, }, - #[error("Path is out of bounds")] - PathOutOfBounds, } /// Resolves a path relative to the current path or to the base path. diff --git a/src/files/service.rs b/src/files/service.rs index 1599a6e..ff9efd6 100644 --- a/src/files/service.rs +++ b/src/files/service.rs @@ -33,10 +33,6 @@ use tokio::sync::RwLock; /// Errors which can occur when serving static files. #[derive(Debug, Error)] pub enum ServiceError { - /// Path is not a directory - #[error("Path is not a directory. Unable to serve static files")] - IsNotDirectory, - /// Cannot render directory #[error("Unable to render directory without index file")] IsDirectory, @@ -44,9 +40,6 @@ pub enum ServiceError { #[error("Serve directory is not ready.")] ServeDirNotReady, - #[error("Unable to obtain read lock for serve dir.")] - ServerDirReadLockFail, - #[error("Unable to find or open the specified file.")] OpenFile { #[source] @@ -71,15 +64,6 @@ pub enum ServiceError { #[error("Unable to render listing")] RenderListing { source: io::Error }, - #[error("Unable to reconstruct request")] - ReconstructRequest, - - #[error("Unable to build file response")] - BuildFileResponse { - #[source] - source: ActixError, - }, - #[error("Custom path not found")] ServeCustomNotFoundPath, } -- GitLab