diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/icu_provider_adapters/src/fork/predicates.rs | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/icu_provider_adapters/src/fork/predicates.rs')
-rw-r--r-- | vendor/icu_provider_adapters/src/fork/predicates.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/icu_provider_adapters/src/fork/predicates.rs b/vendor/icu_provider_adapters/src/fork/predicates.rs index 0fefe5704..58ffa7416 100644 --- a/vendor/icu_provider_adapters/src/fork/predicates.rs +++ b/vendor/icu_provider_adapters/src/fork/predicates.rs @@ -10,6 +10,9 @@ use icu_provider::prelude::*; /// /// [`ForkByErrorProvider`]: super::ForkByErrorProvider pub trait ForkByErrorPredicate { + /// The error to return if there are zero providers. + const UNIT_ERROR: DataErrorKind = DataErrorKind::MissingDataKey; + /// This function is called when a data request fails and there are additional providers /// that could possibly fulfill the request. /// @@ -43,6 +46,8 @@ pub trait ForkByErrorPredicate { pub struct MissingDataKeyPredicate; impl ForkByErrorPredicate for MissingDataKeyPredicate { + const UNIT_ERROR: DataErrorKind = DataErrorKind::MissingDataKey; + #[inline] fn test(&self, _: DataKey, _: Option<DataRequest>, err: DataError) -> bool { matches!( @@ -125,6 +130,8 @@ impl ForkByErrorPredicate for MissingDataKeyPredicate { pub struct MissingLocalePredicate; impl ForkByErrorPredicate for MissingLocalePredicate { + const UNIT_ERROR: DataErrorKind = DataErrorKind::MissingLocale; + #[inline] fn test(&self, _: DataKey, _: Option<DataRequest>, err: DataError) -> bool { matches!( |