From a5cd0e3d23903b17f08a0f7544bccf73866b3456 Mon Sep 17 00:00:00 2001 From: yassun7010 Date: Thu, 16 May 2024 00:56:09 +0900 Subject: [PATCH] chore: update type. --- serde_valid/src/features/fluent/localize.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/serde_valid/src/features/fluent/localize.rs b/serde_valid/src/features/fluent/localize.rs index 8fdf01b..969584c 100644 --- a/serde_valid/src/features/fluent/localize.rs +++ b/serde_valid/src/features/fluent/localize.rs @@ -1,7 +1,7 @@ use fluent::{bundle::FluentBundle, FluentResource}; use crate::validation::error::{ - ArrayErrors, Errors, FormatDefault, ItemErrorsMap, ObjectErrors, PropertyErrorsMap, VecErrors, + ArrayErrors, FormatDefault, ItemErrorsMap, ObjectErrors, PropertyErrorsMap, VecErrors, }; use super::{LocalizedError, TryLocalize}; @@ -14,17 +14,23 @@ pub trait Localize { M: fluent::memoizer::MemoizerKind; } -impl Localize for Errors { - type Target = Errors; +impl Localize for crate::validation::Errors { + type Target = crate::validation::Errors; fn localize(&self, bundle: &FluentBundle) -> Self::Target where M: fluent::memoizer::MemoizerKind, { match self { - Errors::Array(array) => Errors::Array(array.localize(bundle)), - Errors::Object(object) => Errors::Object(object.localize(bundle)), - Errors::NewType(newtype) => Errors::NewType(newtype.localize(bundle)), + crate::validation::Errors::Array(array) => { + crate::validation::Errors::Array(array.localize(bundle)) + } + crate::validation::Errors::Object(object) => { + crate::validation::Errors::Object(object.localize(bundle)) + } + crate::validation::Errors::NewType(newtype) => { + crate::validation::Errors::NewType(newtype.localize(bundle)) + } } } }