summaryrefslogtreecommitdiff
path: root/src/font
diff options
context:
space:
mode:
Diffstat (limited to 'src/font')
-rw-r--r--src/font/book.rs2
-rw-r--r--src/font/variant.rs2
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()
}
}