googlefonts / googlefonts/fontations
charmap().mappings() and Cmap::from_mappings have different types
- Dominant language
- Rust
- Stars
- 826
- Forks
- 75
- Avg merge
- 22h 33m
- Merged PRs (30d)
- 75
Description
Boy this took me too long to work out: `write_fonts::tables::Cmap::from_mappings(font.charmap().mappings().chain(...))` doesn't work, because:
```rust
pub fn from_mappings(
mappings: impl IntoIterator,
)
```
but
```rust
impl Iterator for Mappings<'_> {
type Item = (u32, GlyphId);
```
They're different crates so there's no reason to expect that they should be the same, but the (lack of) parallelism is confusing.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the `Mappings` iterator implementation with `Cmap::from_mappings`, focusing on their `Item` types and the `charmap().mappings()` call shown in the issue. Determine the intended compatible API relationship; done means the confusing type mismatch is resolved or its required conversion is clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100