Skip to content

Commit

Permalink
[write] Remove use of is_sorted
Browse files Browse the repository at this point in the history
This only stabalized in 1.82 and is causing us to fail in oss-fuzz,
which isn't there yet.
  • Loading branch information
cmyr committed Dec 2, 2024
1 parent 1cd540c commit 9829198
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion write-fonts/src/tables/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ impl Name {
}

fn check_sorted_and_unique_name_records(&self, ctx: &mut ValidationCtx) {
if !self.name_record.is_sorted() {
//TODO: replace with `is_sorted` whenever oss_fuzz is using rustc >= 1.82
if self
.name_record
.windows(2)
.any(|window| window[0] > window[1])
{
ctx.report("name_record array must be sorted");
}
for (left, right) in self.name_record.iter().zip(self.name_record.iter().skip(1)) {
Expand Down

0 comments on commit 9829198

Please sign in to comment.