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

[read-fonts] Add 'get' method to coverage tables #647

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Oct 5, 2023

I wanted this for testing the table splitting in Mark2Base, and it's something we will want anyway.

This also fixes a little mixup in the signature of CoverageTable::iter; the elided lifetime here meant the compiler tied the iterator to the lifetime of the table object, whereas we really want to tie it to the lifetime of the underlying data.

JMM

@cmyr
Copy link
Member Author

cmyr commented Oct 5, 2023

ooh, looks like we have a new rustc/clippy.

Also I'm wondering if this shouldn't return usize, since we expect coverage indices to be used mostly to index into collections?

@cmyr cmyr mentioned this pull request Oct 5, 2023
Copy link
Member

@dfrg dfrg left a comment

Choose a reason for hiding this comment

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

Happy to see these and thanks for doing the binary search!

I’m ambivalent on the return type. As u16 matches the spec, this seems good to me as is.

I wanted this for testing the table splitting in Mark2Base, and it's
something we will want anyway.

This also fixes a little mixup in the signature of CoverageTable::iter;
the elided lifetime here meant the compiler tied the iterator to the
lifetime of the table object, whereas we really want to tie it to the
lifetime of the underlying data.
@cmyr cmyr merged commit b3a6f07 into main Oct 6, 2023
8 checks passed
@cmyr cmyr deleted the cov-table-get branch October 6, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants