diff --git a/src/cff/dict.rs b/src/cff/dict.rs index 72f3ffd2..be613655 100644 --- a/src/cff/dict.rs +++ b/src/cff/dict.rs @@ -185,7 +185,7 @@ impl<'a> Structure<'a> for Operand<'a> { } Self::Real(real) => { w.write::(30); - w.give(&real); + w.give(real); } } } diff --git a/src/cff/mod.rs b/src/cff/mod.rs index 7e3fc3e5..6f365ca2 100644 --- a/src/cff/mod.rs +++ b/src/cff/mod.rs @@ -124,7 +124,7 @@ pub(crate) fn subset(ctx: &mut Context) -> Result<()> { } /// Subset the glyph descriptions. -fn subset_char_strings<'a>(ctx: &Context, strings: &mut Index>) -> Result<()> { +fn subset_char_strings(ctx: &Context, strings: &mut Index) -> Result<()> { for glyph in 0..ctx.num_glyphs { if !ctx.subset.contains(&glyph) { // The byte sequence [14] is the minimal valid charstring consisting @@ -318,7 +318,7 @@ fn write_cid_data(w: &mut Writer, cid: &CidData, offsets: &mut CidOffsets) { } /// Read a Private DICT and optionally local subroutines. -fn read_private_dict<'a>(cff: &'a [u8], range: Range) -> Result> { +fn read_private_dict(cff: &[u8], range: Range) -> Result> { let start = range.start; let sub = cff.get(range).ok_or(Error::InvalidOffset)?; let dict = Dict::read_at(sub, 0)?; @@ -520,7 +520,7 @@ impl<'a> Structure<'a> for Opaque<'a> { } fn write(&self, w: &mut Writer) { - w.give(&self.0); + w.give(self.0); } } diff --git a/src/lib.rs b/src/lib.rs index df105ad9..cff518b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -93,7 +93,7 @@ impl<'a> Profile<'a> { pub fn subset(data: &[u8], index: u32, profile: Profile) -> Result> { let face = parse(data, index)?; let kind = match face.table(Tag::CFF).or(face.table(Tag::CFF2)) { - Some(_) => FontKind::CFF, + Some(_) => FontKind::Cff, None => FontKind::TrueType, }; @@ -119,7 +119,7 @@ pub fn subset(data: &[u8], index: u32, profile: Profile) -> Result> { ctx.process(Tag::GASP)?; } - if ctx.kind == FontKind::CFF { + if ctx.kind == FontKind::Cff { cff::discover(&mut ctx); ctx.process(Tag::CFF)?; ctx.process(Tag::CFF2)?; @@ -329,7 +329,7 @@ enum FontKind { /// TrueType outlines. TrueType, /// CFF outlines - CFF, + Cff, /// A font collection. Collection, } @@ -338,7 +338,7 @@ impl Structure<'_> for FontKind { fn read(r: &mut Reader) -> Result { match r.read::()? { 0x00010000 | 0x74727565 => Ok(FontKind::TrueType), - 0x4F54544F => Ok(FontKind::CFF), + 0x4F54544F => Ok(FontKind::Cff), 0x74746366 => Ok(FontKind::Collection), _ => Err(Error::UnknownKind), } @@ -347,7 +347,7 @@ impl Structure<'_> for FontKind { fn write(&self, w: &mut Writer) { w.write::(match self { FontKind::TrueType => 0x00010000, - FontKind::CFF => 0x4F54544F, + FontKind::Cff => 0x4F54544F, FontKind::Collection => 0x74746366, }) } @@ -523,7 +523,7 @@ mod tests { } fn test(path: &str, text: &str) { - test_impl(path, &text, true); + test_impl(path, text, true); } fn test_full(path: &str) {