Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce borrowed variants of normalizer structs #5413

Merged
merged 8 commits into from
Aug 23, 2024

Conversation

hsivonen
Copy link
Member

@hsivonen hsivonen commented Aug 21, 2024

Addresses #5187 for the normalizer. HarfBuzz deliberately out of scope for this PR.

@hsivonen hsivonen requested a review from robertbastian August 21, 2024 10:56
@hsivonen hsivonen requested review from Manishearth, echeran and a team as code owners August 21, 2024 10:56
@hsivonen hsivonen added C-collator Component: Collation, normalization 2.0-breaking Changes that are breaking API changes labels Aug 21, 2024
@hsivonen
Copy link
Member Author

I had the wrong assumption of how icu_harfbuzz works. Adding the requisite changes to this PR after all.

@@ -89,6 +90,49 @@ impl CanonicalComposition {
///
/// [📚 Help choosing a constructor](icu_provider::constructors)
#[cfg(feature = "compiled_data")]
pub const fn new() -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For existing borrowed types we use Owned::new() -> Borrowed. This keeps the constructors together. I think we should discuss if that's what we want to do, but for now do it for consistency.

Copy link
Member

@sffc sffc Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm warming up to the idea that it should be Borrowed::new() because we might want to be able to cfg-out the whole owned class at some point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let @robertbastian review in detail since he's most familiar with the owned/borrowed compiled data architecture and is in the correct time zone, but from a drive-by, this looks quite good!

Manishearth
Manishearth previously approved these changes Aug 22, 2024
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine

@sffc
Copy link
Member

sffc commented Aug 22, 2024

I pushed a cargo make diplomat-gen to @hsivonen's branch in order to pass CI

sffc
sffc previously approved these changes Aug 22, 2024
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm extremely happy about this landing! Thank you @hsivonen

@sffc
Copy link
Member

sffc commented Aug 23, 2024

gn is broken on main. Merging.

@sffc sffc merged commit 4c4ab57 into unicode-org:main Aug 23, 2024
27 of 28 checks passed
@sffc sffc mentioned this pull request Aug 23, 2024
@hsivonen hsivonen deleted the borrowednormalizerbis branch August 23, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0-breaking Changes that are breaking API changes C-collator Component: Collation, normalization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants