yeslogic / allsorts

Font parser, shaping engine, and subsetter implemented in Rust
https://yeslogic.com/blog/allsorts-rust-font-shaping-engine/
Apache License 2.0
706 stars 23 forks source link

Use `u32::from_be_bytes` in `tag!` macro #71

Closed LoganDark closed 2 years ago

LoganDark commented 2 years ago

OK, so I saw this while working on #69 and couldn't ignore it. You're doing manual bit shifting when you could be using u32::from_be_bytes. I'm not aware of any reason for this, so I swapped it out and it works just fine.

from_be_bytes has been const-stable since Rust 1.44.0. (Admittedly this is newer than allsorts itself.)

LoganDark commented 2 years ago

We previously targeted versions of the compiler where it was not const stable.

Hence the "Admittedly this is newer than allsorts itself" :)

wezm commented 2 years ago

Merged manually.