From 3c92bad9a7cd6b880de197806443ffcce2cac9d8 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 31 Jul 2021 22:59:14 +0200 Subject: Pretty-printed diagnostics with traceback --- src/layout/frame.rs | 5 ++--- src/layout/incremental.rs | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/layout') diff --git a/src/layout/frame.rs b/src/layout/frame.rs index 82ac71a9..6d5cc2f3 100644 --- a/src/layout/frame.rs +++ b/src/layout/frame.rs @@ -146,9 +146,8 @@ impl Text { pub fn encode_glyphs_be(&self) -> Vec { let mut bytes = Vec::with_capacity(2 * self.glyphs.len()); for glyph in &self.glyphs { - let id = glyph.id; - bytes.push((id >> 8) as u8); - bytes.push((id & 0xff) as u8); + bytes.push((glyph.id >> 8) as u8); + bytes.push((glyph.id & 0xff) as u8); } bytes } diff --git a/src/layout/incremental.rs b/src/layout/incremental.rs index e7d12d10..32353d6f 100644 --- a/src/layout/incremental.rs +++ b/src/layout/incremental.rs @@ -8,7 +8,7 @@ use super::*; /// /// _This is only available when the `layout-cache` feature is enabled._ #[cfg(feature = "layout-cache")] -#[derive(Debug, Default, Clone)] +#[derive(Default, Clone)] pub struct LayoutCache { /// Maps from node hashes to the resulting frames and regions in which the /// frames are valid. The right hand side of the hash map is a vector of @@ -70,9 +70,9 @@ impl LayoutCache { ) { let entry = FramesEntry::new(frames, level); match self.frames.entry(hash) { - Entry::Occupied(o) => o.into_mut().push(entry), - Entry::Vacant(v) => { - v.insert(vec![entry]); + Entry::Occupied(occupied) => occupied.into_mut().push(entry), + Entry::Vacant(vacant) => { + vacant.insert(vec![entry]); } } } -- cgit v1.2.3