Skip to content

Commit

Permalink
fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tigregalis committed Oct 2, 2023
1 parent 6dc9792 commit c06b9a7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,25 @@ impl<'a> Attrs<'a> {
}

/// Set font size
///
///
/// # Panics
///
///
/// Will panic if font size is zero.
pub fn size(mut self, size: f32) -> Self {
assert_ne!(inner, 0.0, "font size cannot be 0");
assert_ne!(size, 0.0, "font size cannot be 0");
self.font_size = size;
self
}

/// Set line height
///
///
/// # Panics
///
///
/// Will panic if line height is zero.
pub fn line_height(mut self, line_height: LineHeight) -> Self {
let LineHeight::Absolute(inner) | LineHeight::Proportional(inner) = line_height;
let inner = match line_height {
LineHeight::Absolute(inner) | LineHeight::Proportional(inner) => inner,
};
assert_ne!(inner, 0.0, "line height cannot be 0");
self.line_height = line_height;
self
Expand Down Expand Up @@ -236,9 +238,9 @@ impl<'a> Attrs<'a> {
}

/// Scale the font size and line height
///
///
/// # Panics
///
///
/// Will panic if scale is zero.
pub fn scale(mut self, scale: f32) -> Self {
assert_ne!(scale, 0.0, "scale cannot be 0");
Expand Down

0 comments on commit c06b9a7

Please sign in to comment.