Skip to content

Commit

Permalink
Use DataPayload::cast() where possible (#3429)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed May 12, 2023
1 parent 84f5014 commit 801fb30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions components/properties/src/props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl<T: TrieValue> PropertyValueNameToEnumMapper<T> {
M: DataMarker<Yokeable = PropertyValueNameToEnumMapV1<'static>>,
{
Self {
map: data.map_project(|m, _| m),
map: data.cast(),
markers: PhantomData,
}
}
Expand Down Expand Up @@ -329,7 +329,7 @@ impl<T: TrieValue> PropertyEnumToValueNameSparseMapper<T> {
M: DataMarker<Yokeable = PropertyEnumToValueNameSparseMapV1<'static>>,
{
Self {
map: data.map_project(|m, _| m),
map: data.cast(),
markers: PhantomData,
}
}
Expand Down Expand Up @@ -437,7 +437,7 @@ impl<T: TrieValue> PropertyEnumToValueNameLinearMapper<T> {
M: DataMarker<Yokeable = PropertyEnumToValueNameLinearMapV1<'static>>,
{
Self {
map: data.map_project(|m, _| m),
map: data.cast(),
markers: PhantomData,
}
}
Expand Down Expand Up @@ -531,7 +531,7 @@ impl<T: TrieValue> PropertyEnumToValueNameLinearTiny4Mapper<T> {
M: DataMarker<Yokeable = PropertyEnumToValueNameLinearTiny4MapV1<'static>>,
{
Self {
map: data.map_project(|m, _| m),
map: data.cast(),
markers: PhantomData,
}
}
Expand Down
8 changes: 2 additions & 6 deletions components/properties/src/sets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ impl CodePointSetData {
where
M: DataMarker<Yokeable = PropertyCodePointSetV1<'static>>,
{
Self {
data: data.map_project(|m, _| m),
}
Self { data: data.cast() }
}

/// Construct a new owned [`CodePointInversionList`]
Expand Down Expand Up @@ -247,9 +245,7 @@ impl UnicodeSetData {
where
M: DataMarker<Yokeable = PropertyUnicodeSetV1<'static>>,
{
Self {
data: data.map_project(|m, _| m),
}
Self { data: data.cast() }
}

/// Construct a new owned [`CodePointInversionListAndStringList`]
Expand Down

0 comments on commit 801fb30

Please sign in to comment.