Skip to content

Commit

Permalink
refactor: switched the order of impl so that its intent is clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
eerii committed Mar 7, 2024
1 parent 3a7a386 commit 30ded4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions components/gfx/text/glyph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,18 @@ struct DetailedGlyphRecord {
detail_offset: usize,
}

impl PartialOrd for DetailedGlyphRecord {
fn partial_cmp(&self, other: &DetailedGlyphRecord) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl Ord for DetailedGlyphRecord {
fn cmp(&self, other: &DetailedGlyphRecord) -> Ordering {
self.entry_offset.cmp(&other.entry_offset)
}
}

impl PartialOrd for DetailedGlyphRecord {
fn partial_cmp(&self, other: &DetailedGlyphRecord) -> Option<Ordering> {
Some(self.cmp(other))
}
}

// Manages the lookup table for detailed glyphs. Sorting is deferred
// until a lookup is actually performed; this matches the expected
// usage pattern of setting/appending all the detailed glyphs, and
Expand Down

0 comments on commit 30ded4f

Please sign in to comment.