WIP: Añade componente para la gestión de menús #8

Draft
manuelcillero wants to merge 54 commits from add-menu-component into main
2 changed files with 10 additions and 10 deletions
Showing only changes of commit 5aa40c5ea2 - Show all commits

View file

@ -145,9 +145,9 @@ impl UnitValue {
impl fmt::Display for UnitValue { impl fmt::Display for UnitValue {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
UnitValue::None => write!(f, ""), UnitValue::None => Ok(()),
UnitValue::Auto => write!(f, "auto"), UnitValue::Auto => f.write_str("auto"),
UnitValue::Zero => write!(f, "0"), UnitValue::Zero => f.write_str("0"),
// Valor absoluto. // Valor absoluto.
UnitValue::Cm(av) => write!(f, "{av}cm"), UnitValue::Cm(av) => write!(f, "{av}cm"),
UnitValue::In(av) => write!(f, "{av}in"), UnitValue::In(av) => write!(f, "{av}in"),

View file

@ -24,9 +24,9 @@ impl Display for ErrorPage {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
// Error 304. // Error 304.
ErrorPage::NotModified(_) => write!(f, "Not Modified"), ErrorPage::NotModified(_) => f.write_str("Not Modified"),
// Error 400. // Error 400.
ErrorPage::BadRequest(_) => write!(f, "Bad Client Data"), ErrorPage::BadRequest(_) => f.write_str("Bad Client Data"),
// Error 403. // Error 403.
ErrorPage::AccessDenied(request) => { ErrorPage::AccessDenied(request) => {
let mut error_page = Page::new(request.clone()); let mut error_page = Page::new(request.clone());
@ -39,7 +39,7 @@ impl Display for ErrorPage {
{ {
write!(f, "{}", page.into_string()) write!(f, "{}", page.into_string())
} else { } else {
write!(f, "Access Denied") f.write_str("Access Denied")
} }
} }
// Error 404. // Error 404.
@ -54,15 +54,15 @@ impl Display for ErrorPage {
{ {
write!(f, "{}", page.into_string()) write!(f, "{}", page.into_string())
} else { } else {
write!(f, "Not Found") f.write_str("Not Found")
} }
} }
// Error 412. // Error 412.
ErrorPage::PreconditionFailed(_) => write!(f, "Precondition Failed"), ErrorPage::PreconditionFailed(_) => f.write_str("Precondition Failed"),
// Error 500. // Error 500.
ErrorPage::InternalError(_) => write!(f, "Internal Error"), ErrorPage::InternalError(_) => f.write_str("Internal Error"),
// Error 504. // Error 504.
ErrorPage::Timeout(_) => write!(f, "Timeout"), ErrorPage::Timeout(_) => f.write_str("Timeout"),
} }
} }
} }