diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-03 11:44:53 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-03 13:35:39 +0100 |
| commit | 37a7afddfaffd44cb9bc013c9506599267e08983 (patch) | |
| tree | 20e7d62d3c5418baff01a21d0406b91bf3096214 /src/font | |
| parent | 56342bd972a13ffe21beaf2b87ab7eb1597704b4 (diff) | |
Split crates
Diffstat (limited to 'src/font')
| -rw-r--r-- | src/font/book.rs | 2 | ||||
| -rw-r--r-- | src/font/variant.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/font/book.rs b/src/font/book.rs index d900d3c4..49225c04 100644 --- a/src/font/book.rs +++ b/src/font/book.rs @@ -170,7 +170,7 @@ bitflags::bitflags! { impl FontInfo { /// Compute metadata for all fonts in the given data. - pub fn from_data<'a>(data: &'a [u8]) -> impl Iterator<Item = FontInfo> + 'a { + pub fn from_data(data: &[u8]) -> impl Iterator<Item = FontInfo> + '_ { let count = ttf_parser::fonts_in_collection(data).unwrap_or(1); (0 .. count).filter_map(move |index| { let ttf = ttf_parser::Face::parse(data, index).ok()?; diff --git a/src/font/variant.rs b/src/font/variant.rs index 9e16afc8..085f2ae7 100644 --- a/src/font/variant.rs +++ b/src/font/variant.rs @@ -111,7 +111,7 @@ impl FontWeight { /// The absolute number distance between this and another font weight. pub fn distance(self, other: Self) -> u16 { - (self.0 as i16 - other.0 as i16).abs() as u16 + (self.0 as i16 - other.0 as i16).unsigned_abs() } } |
