Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clippy] Push the rock back up the hill #752

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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