Skip to content

Commit

Permalink
Make DataPayload::new_owned() no longer const (#4456)
Browse files Browse the repository at this point in the history
Technically breaking, but I think this constness was a mistake and we
don't use it internally (and there's very little reason for someone to
use it externally, the static stuff exists).

This is useful for #4449 ; it
allows us to reference statics in the constructor of `DataPayload()`
which lets us reference a *proper* sentinel rather than a made-up value
that will not work in WASM.
  • Loading branch information
Manishearth authored Dec 18, 2023
1 parent 7a27226 commit 1d975c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- Components
- `icu_properties`
- Add `Aran` script code (https://github.com/unicode-org/icu4x/pull/4426)
- Data model and providers
- `icu_provider`
- (Small breakage) `DataPayload::new_owned()` is no longer `const`, this was a mistake (https://github.com/unicode-org/icu4x/pull/4456)
- FFI:
- All languages
- Correctly handle invalid UTF8 (https://github.com/unicode-org/icu4x/pull/4353)
Expand Down
2 changes: 1 addition & 1 deletion provider/core/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ where
/// assert_eq!(payload.get(), &local_struct);
/// ```
#[inline]
pub const fn from_owned(data: M::Yokeable) -> Self {
pub fn from_owned(data: M::Yokeable) -> Self {
Self(DataPayloadInner::Yoke(Yoke::new_owned(data)))
}

Expand Down

0 comments on commit 1d975c4

Please sign in to comment.