Skip to content

Commit

Permalink
Make remapper implement hash
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Jun 7, 2024
1 parent 1a7654f commit 677d31d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/remapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Add;

/// A structure that allows to remap numeric types to new
/// numbers so that they form a contiguous sequence of numbers.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Hash)]
pub struct Remapper<C, T> {
/// The counter that keeps track of the next number to be assigned.
/// Should always start with 0.
Expand Down Expand Up @@ -98,7 +98,7 @@ impl<C: CheckedAdd + Copy + From<u8>, T: Ord + Copy + From<u8> + From<C>> Remapp
/// This is necessary because a font needs to have a contiguous sequence of
/// glyph IDs that start from 0, so we cannot just reuse the old ones, but we
/// need to define a mapping.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Hash)]
pub struct GlyphRemapper(Remapper<u16, u16>);

impl Default for GlyphRemapper {
Expand Down

0 comments on commit 677d31d

Please sign in to comment.