mirror of
https://github.com/actix/examples
synced 2025-06-26 09:17:41 +02:00
chore: update derive_more to v2
This commit is contained in:
@ -6,7 +6,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
actix-web.workspace = true
|
||||
|
||||
derive_more.workspace = true
|
||||
derive_more = { workspace = true, features = ["display"] }
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
rand.workspace = true
|
||||
|
@ -13,7 +13,7 @@ http errors will be chosen, each with an equal chance of being selected:
|
||||
*/
|
||||
|
||||
use actix_web::{web, App, Error, HttpResponse, HttpServer, ResponseError};
|
||||
use derive_more::Display; // naming it clearly for illustration purposes
|
||||
use derive_more::Display;
|
||||
use rand::{
|
||||
distr::{Distribution, StandardUniform},
|
||||
Rng,
|
||||
@ -21,13 +21,13 @@ use rand::{
|
||||
|
||||
#[derive(Debug, Display)]
|
||||
pub enum CustomError {
|
||||
#[display(fmt = "Custom Error 1")]
|
||||
#[display("Custom Error 1")]
|
||||
CustomOne,
|
||||
#[display(fmt = "Custom Error 2")]
|
||||
#[display("Custom Error 2")]
|
||||
CustomTwo,
|
||||
#[display(fmt = "Custom Error 3")]
|
||||
#[display("Custom Error 3")]
|
||||
CustomThree,
|
||||
#[display(fmt = "Custom Error 4")]
|
||||
#[display("Custom Error 4")]
|
||||
CustomFour,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user