Skip to content

Commit

Permalink
Merge pull request #674 from googlefonts/fix-clippy
Browse files Browse the repository at this point in the history
make clippy happy again
  • Loading branch information
anthrotype authored Jan 12, 2024
2 parents 977786f + d3eeeef commit fc9584d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion fea-rs/src/token_tree/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a, 'b> ReparseCtx<'a, 'b> {
fn eat_trivia(&mut self) {
while self
.in_buf
.get(0)
.first()
.map(|t| t.kind().is_trivia())
.unwrap_or(false)
{
Expand Down
8 changes: 6 additions & 2 deletions fontbe/src/marks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,15 @@ fn resolve_anchor(

let (x_default, x_deltas) = crate::features::resolve_variable_metric(
static_metadata,
x_values.iter().map(|(pos, value)| (pos, value)),
// If I do map(|(pos, value)| (pos, value)) to destructure the tuple and
// convert &(T, V) => (&T, &V) as the values parameter expects, then
// clippy complains about the seemingly no-op identity map:
// https://rust-lang.github.io/rust-clippy/master/index.html#/map_identity
x_values.iter().map(|item| (&item.0, &item.1)),
)?;
let (y_default, y_deltas) = crate::features::resolve_variable_metric(
static_metadata,
y_values.iter().map(|(pos, value)| (pos, value)),
y_values.iter().map(|item| (&item.0, &item.1)),
)?;
Ok(fea_rs::compile::Anchor::new(x_default, y_default)
.with_x_device(x_deltas)
Expand Down
2 changes: 1 addition & 1 deletion layout-normalizer/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Feature {
(
tag_to_int(self.feature),
self.lang_systems
.get(0)
.first()
.map(|rec| (tag_to_int(rec.script), tag_to_int(rec.lang))),
)
}
Expand Down
10 changes: 2 additions & 8 deletions layout-normalizer/src/gpos/marks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ fn append_mark_base_rules(
let group = MarkAttachmentRule {
base: base_glyph,
base_anchor,
marks: marks
.into_iter()
.map(|(anchor, glyphs)| (anchor, glyphs))
.collect(),
marks,
};
result.push(group);
}
Expand Down Expand Up @@ -175,10 +172,7 @@ fn append_mark_mark_rules(
let group = MarkAttachmentRule {
base: base_glyph,
base_anchor,
marks: marks
.into_iter()
.map(|(anchor, glyphs)| (anchor, glyphs))
.collect(),
marks,
};
result.push(group);
}
Expand Down

0 comments on commit fc9584d

Please sign in to comment.