From 2cb963350341997fea9b10030278fb930dc242a1 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Thu, 21 Aug 2025 09:36:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Retoques=20al=20importar=20`fmt`?= =?UTF-8?q?=20para=20usar=20`Display`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/html/context.rs | 5 ++--- src/response/page/error.rs | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/html/context.rs b/src/html/context.rs index 5fbb39b5..72c0ff29 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 3a2511cf..99ba62bf 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.