Skip to content

Commit

Permalink
[clippy] Push the rock back up the hill
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyr committed Jan 8, 2024
1 parent 7fd954e commit a03bc51
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions read-fonts/src/tables/fvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod tests {
let font = FontRef::new(font_test_data::VAZIRMATN_VAR).unwrap();
let fvar = font.fvar().unwrap();
assert_eq!(fvar.axis_count(), 1);
let wght = &fvar.axes().unwrap().get(0).unwrap();
let wght = &fvar.axes().unwrap().first().unwrap();
assert_eq!(wght.axis_tag(), Tag::new(b"wght"));
assert_eq!(wght.min_value(), Fixed::from_f64(100.0));
assert_eq!(wght.default_value(), Fixed::from_f64(400.0));
Expand All @@ -70,7 +70,7 @@ mod tests {
let instance = instances.get(i).unwrap();
assert_eq!(instance.coordinates.len(), 1);
assert_eq!(
instance.coordinates.get(0).unwrap().get(),
instance.coordinates.first().unwrap().get(),
Fixed::from_f64(value)
);
assert_eq!(instance.subfamily_name_id, name_id);
Expand All @@ -82,7 +82,7 @@ mod tests {
fn normalize() {
let font = FontRef::new(font_test_data::VAZIRMATN_VAR).unwrap();
let fvar = font.fvar().unwrap();
let axis = fvar.axes().unwrap().get(0).unwrap();
let axis = fvar.axes().unwrap().first().unwrap();
let values = [100.0, 220.0, 250.0, 400.0, 650.0, 900.0];
let expected = [-1.0, -0.60001, -0.5, 0.0, 0.5, 1.0];
for (value, expected) in values.into_iter().zip(expected) {
Expand Down
1 change: 1 addition & 0 deletions write-fonts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub extern crate font_types as types;
pub extern crate read_fonts as read;

/// types used in autogenerated code.
#[allow(unused_imports)]
pub(crate) mod codegen_prelude {
use std::num::TryFromIntError;

Expand Down
2 changes: 1 addition & 1 deletion write-fonts/src/tables/gvar/iup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ fn iup_contour_optimize(
// Get the easy cases out of the way
// Easy: all points are the same or there are no points
// This covers the case when there is only one point
let Some(first_delta) = deltas.get(0) else {
let Some(first_delta) = deltas.first() else {
return Ok(Vec::new());
};
if deltas.iter().all(|d| d == first_delta) {
Expand Down

0 comments on commit a03bc51

Please sign in to comment.