Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Jul 3, 2023
1 parent 4053f04 commit ab492f8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion components/properties/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
9 changes: 9 additions & 0 deletions components/properties/src/bidi_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
4 changes: 1 addition & 3 deletions components/properties/src/maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ impl<T: TrieValue> CodePointMapData<T> {
/// ```
/// 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::<u8>().unwrap();
/// let gc = gc.as_borrowed();
Expand Down

0 comments on commit ab492f8

Please sign in to comment.