Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Feb 26, 2025
1 parent 467037a commit 121a1a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions provider/core/src/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ use core::fmt::Debug;
use icu_locale_core::preferences::define_preferences;
use writeable::Writeable;
use yoke::*;
use zerofrom::*;

/// A struct containing "Hello World" in the requested language.
#[derive(Debug, PartialEq, Clone, Yokeable)]
#[derive(Debug, PartialEq, Clone, Yokeable, ZeroFrom)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
#[cfg_attr(
any(feature = "deserialize_json", feature = "export"),
Expand All @@ -40,7 +41,7 @@ impl Default for HelloWorld<'_> {
}
}

impl<'a> zerofrom::ZeroFrom<'a, str> for HelloWorld<'a> {
impl<'a> ZeroFrom<'a, str> for HelloWorld<'a> {
fn zero_from(message: &'a str) -> Self {
HelloWorld {
message: Cow::Borrowed(message),
Expand Down
2 changes: 1 addition & 1 deletion provider/core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use zerovec::ule::*;
/// use icu_provider::prelude::*;
/// use std::borrow::Cow;
///
/// #[derive(yoke::Yokeable)]
/// #[derive(yoke::Yokeable, zerofrom::ZeroFrom)]
/// struct MyDataStruct<'data> {
/// message: Cow<'data, str>,
/// }
Expand Down
2 changes: 2 additions & 0 deletions tutorials/data_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ pub struct Custom<'data> {
message: Cow<'data, str>,
};

icu_provider::data_struct!(Custom<'_>);

struct CustomProvider;
impl DataProvider<CustomV1> for CustomProvider {
fn load(&self, req: DataRequest) -> Result<DataResponse<CustomV1>, DataError> {
Expand Down

0 comments on commit 121a1a1

Please sign in to comment.