1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

build(deps): update derive_more to v1.0 (#3453)

* build(deps): update derive_more to v1.0

* refactor: use from derive module

---------

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
John Vandenberg
2024-08-18 22:17:03 +08:00
committed by GitHub
parent 78ac5cf482
commit d6bdfac1b9
40 changed files with 204 additions and 194 deletions

View File

@ -2,6 +2,8 @@
## Unreleased
- Minimum supported Rust version (MSRV) is now 1.75.
## 0.6.6
- Update `tokio-uring` dependency to `0.4`.

View File

@ -33,7 +33,7 @@ actix-web = { version = "4", default-features = false }
bitflags = "2"
bytes = "1"
derive_more = "0.99.5"
derive_more = { version = "1", features = ["display", "error", "from"] }
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
http-range = "0.1.4"
log = "0.4"

View File

@ -1,16 +1,16 @@
use actix_web::{http::StatusCode, ResponseError};
use derive_more::Display;
use derive_more::derive::Display;
/// Errors which can occur when serving static files.
#[derive(Debug, PartialEq, Eq, Display)]
pub enum FilesError {
/// Path is not a directory.
#[allow(dead_code)]
#[display(fmt = "path is not a directory. Unable to serve static files")]
#[display("path is not a directory. Unable to serve static files")]
IsNotDirectory,
/// Cannot render directory.
#[display(fmt = "unable to render directory without index file")]
#[display("unable to render directory without index file")]
IsDirectory,
}
@ -25,19 +25,19 @@ impl ResponseError for FilesError {
#[non_exhaustive]
pub enum UriSegmentError {
/// Segment started with the wrapped invalid character.
#[display(fmt = "segment started with invalid character: ('{_0}')")]
#[display("segment started with invalid character: ('{_0}')")]
BadStart(char),
/// Segment contained the wrapped invalid character.
#[display(fmt = "segment contained invalid character ('{_0}')")]
#[display("segment contained invalid character ('{_0}')")]
BadChar(char),
/// Segment ended with the wrapped invalid character.
#[display(fmt = "segment ended with invalid character: ('{_0}')")]
#[display("segment ended with invalid character: ('{_0}')")]
BadEnd(char),
/// Path is not a valid UTF-8 string after percent-decoding.
#[display(fmt = "path is not a valid UTF-8 string after percent-decoding")]
#[display("path is not a valid UTF-8 string after percent-decoding")]
NotValidUtf8,
}

View File

@ -21,7 +21,7 @@ use actix_web::{
Error, HttpMessage, HttpRequest, HttpResponse, Responder,
};
use bitflags::bitflags;
use derive_more::{Deref, DerefMut};
use derive_more::derive::{Deref, DerefMut};
use futures_core::future::LocalBoxFuture;
use mime::Mime;

View File

@ -1,6 +1,6 @@
use std::fmt;
use derive_more::Error;
use derive_more::derive::Error;
/// Copy of `http_range::HttpRangeParseError`.
#[derive(Debug, Clone)]