diff --git a/src/html/context.rs b/src/html/context.rs index 5fbb39b..72c0ff2 100644 --- a/src/html/context.rs +++ b/src/html/context.rs @@ -9,10 +9,9 @@ use crate::{builder_fn, join}; use std::collections::HashMap; use std::error::Error; +use std::fmt::{self, Display}; use std::str::FromStr; -use std::fmt; - /// Operaciones para modificar el contexto ([`Context`]) del documento. pub enum AssetsOp { // Favicon. @@ -43,7 +42,7 @@ pub enum ErrorParam { ParseError(String), } -impl fmt::Display for ErrorParam { +impl Display for ErrorParam { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { ErrorParam::NotFound => write!(f, "Parameter not found"), diff --git a/src/response/page/error.rs b/src/response/page/error.rs index 3a2511c..99ba62b 100644 --- a/src/response/page/error.rs +++ b/src/response/page/error.rs @@ -6,7 +6,7 @@ use crate::service::{HttpRequest, HttpResponse}; use super::Page; -use std::fmt; +use std::fmt::{self, Display}; #[derive(Debug)] pub enum ErrorPage { @@ -19,7 +19,7 @@ pub enum ErrorPage { Timeout(HttpRequest), } -impl fmt::Display for ErrorPage { +impl Display for ErrorPage { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { // Error 304.