Change ToRouteSegments to borrow self (#2283)

* Change display route segments to borrow the type

* fix formatting
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-06-07 12:40:50 -07:00
1 parent 0127501dbf
commit a35436ee4f
3 files changed
+25 -19

No files matched your search

+6 -1
View File
@@ -657,11 +657,16 @@ impl RouteEnum {
#[allow(non_camel_case_types)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Debug, PartialEq)]
pub enum #match_error_name {
#(#error_variants),*
}
impl std::fmt::Debug for #match_error_name {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}({})", stringify!(#match_error_name), self)
}
}
impl std::fmt::Display for #match_error_name {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
+6 -1
View File
@@ -279,13 +279,18 @@ pub(crate) fn create_error_type(
quote! {
#[allow(non_camel_case_types)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Debug, PartialEq)]
pub enum #error_name {
ExtraSegments(String),
#(#child_type_variant,)*
#(#error_variants,)*
}
impl std::fmt::Debug for #error_name {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}({})", stringify!(#error_name), self)
}
}
impl std::fmt::Display for #error_name {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {