Skip to content

Commit

Permalink
Hack around warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed May 13, 2024
1 parent e1fec1c commit e111606
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/bin/diffenator3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ fn main() {
let mut font_a = DFont::new(&font_binary_a);
let mut font_b = DFont::new(&font_binary_b);
if let Some(loc) = cli.location {
font_a.set_location(&loc);
font_b.set_location(&loc);
let _hack = font_a.set_location(&loc);
let _hack = font_b.set_location(&loc);
} else if let Some(inst) = cli.instance {
font_a.set_instance(&inst).expect("Couldn't find instance");
font_b.set_instance(&inst).expect("Couldn't find instance");
Expand Down
4 changes: 2 additions & 2 deletions src/dfont.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use font_types::NameId;
use read_fonts::{FontRef, TableProvider};
use read_fonts::FontRef;
use skrifa::{instance::Location, setting::VariationSetting, MetadataProvider};
use std::{
borrow::Cow,
Expand Down Expand Up @@ -99,7 +99,7 @@ impl DFont {
let value = parts.next().ok_or("Couldn't parse value".to_string())?;
let value = value
.parse::<f32>()
.map_err(|e| "Couldn't parse value".to_string())?;
.map_err(|_| "Couldn't parse value".to_string())?;
settings.push((axis, value).into());
}
Ok(self.fontref().axes().location(&settings))
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ cfg_if! {
pub fn diff_glyphs(font_a: &[u8], font_b: &[u8], location: &str, f: &js_sys::Function) {
let mut f_a = DFont::new(font_a);
let mut f_b = DFont::new(font_b);
f_a.set_location(location);
f_b.set_location(location);
let _hack = f_a.set_location(location);
let _hack = f_b.set_location(location);

let val = json!({
"glyphs": test_font_glyphs(&f_a, &f_b)
Expand All @@ -89,8 +89,8 @@ cfg_if! {
pub fn diff_words(font_a: &[u8], font_b: &[u8], location: &str, f: &js_sys::Function) {
let mut f_a = DFont::new(font_a);
let mut f_b = DFont::new(font_b);
f_a.set_location(location);
f_b.set_location(location);
let _hack = f_a.set_location(location);
let _hack = f_b.set_location(location);


let val = json!({
Expand Down

0 comments on commit e111606

Please sign in to comment.