diff --git a/Cargo.lock b/Cargo.lock index 95b74da5445..34097ec57f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1863,7 +1863,6 @@ dependencies = [ "icu_locid_transform", "icu_properties_data", "icu_provider", - "icu_testdata", "serde", "tinystr", "unicode-bidi", diff --git a/components/properties/Cargo.toml b/components/properties/Cargo.toml index 13bc89004ea..4c281acd25e 100644 --- a/components/properties/Cargo.toml +++ b/components/properties/Cargo.toml @@ -44,7 +44,6 @@ icu_locid_transform = { version = "1.2.0", path = "../../components/locid_transf [dev-dependencies] icu = { path = "../icu", default-features = false } -icu_testdata = { path = "../../provider/testdata", default-features = false, features = ["icu_properties", "icu_locid_transform"] } [features] std = ["icu_collections/std", "icu_provider/std"] diff --git a/components/properties/src/bidi_data.rs b/components/properties/src/bidi_data.rs index 00748f4d886..b25ff3dc152 100644 --- a/components/properties/src/bidi_data.rs +++ b/components/properties/src/bidi_data.rs @@ -159,6 +159,15 @@ impl<'a> BidiAuxiliaryPropertiesBorrowed<'a> { } } +impl BidiAuxiliaryPropertiesBorrowed<'static> { + /// Cheaply converts a `BidiAuxiliaryPropertiesBorrowed<'static>` into a `BidiAuxiliaryProperties`. + pub fn static_to_owned(self) -> BidiAuxiliaryProperties { + BidiAuxiliaryProperties { + data: DataPayload::from_static_ref(self.data), + } + } +} + /// Returns a [`BidiAuxiliaryPropertiesV1`] struct that represents the data for certain /// Bidi properties. /// diff --git a/components/properties/src/maps.rs b/components/properties/src/maps.rs index 262f1d606c7..9d8f465e7e5 100644 --- a/components/properties/src/maps.rs +++ b/components/properties/src/maps.rs @@ -65,9 +65,7 @@ impl CodePointMapData { /// ``` /// use icu::properties::{maps, GeneralCategory}; /// - /// let data = - /// maps::load_general_category(&icu_testdata::unstable()) - /// .expect("The data should be valid"); + /// let data = maps::general_category().static_to_owned(); /// /// let gc = data.try_into_converted::().unwrap(); /// let gc = gc.as_borrowed();