Skip to content

Commit 4f5fec3

Browse files
committed
clean up unused things
1 parent 6e5b04e commit 4f5fec3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plotters/src/style/font/ab_glyph.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl Error for FontError {}
5656
impl FontData for FontDataInternal {
5757
// TODO: can we rename this to `Error`?
5858
type ErrorType = FontError;
59-
fn new(family: FontFamily<'_>, style: FontStyle) -> Result<Self, Self::ErrorType> {
59+
fn new(family: FontFamily<'_>, _style: FontStyle) -> Result<Self, Self::ErrorType> {
6060
Ok(Self {
6161
font_ref: FONTS
6262
.read()
@@ -69,7 +69,7 @@ impl FontData for FontDataInternal {
6969
// TODO: ngl, it makes no sense that this uses the same error type as `new`
7070
fn estimate_layout(&self, size: f64, text: &str) -> Result<LayoutBox, Self::ErrorType> {
7171
let pixel_per_em = size / 1.24;
72-
let units_per_em = self.font_ref.units_per_em().unwrap();
72+
// let units_per_em = self.font_ref.units_per_em().unwrap();
7373
let font = self.font_ref.as_scaled(size as f32);
7474

7575
let mut x_pixels = 0f32;
@@ -108,14 +108,13 @@ impl FontData for FontDataInternal {
108108
prev = Some(c);
109109
let glyph = font.scaled_glyph(c);
110110
if let Some(q) = font.outline_glyph(glyph) {
111-
use ::std::panic::{self, AssertUnwindSafe};
112111
let rect = q.px_bounds();
113112
let y_shift = ((size as f32) / 2.0 + rect.min.y) as i32;
114113
let x_shift = x_shift as i32;
115114
let mut buf = vec![];
116115
q.draw(|x, y, c| buf.push((x, y, c)));
117116
for (x, y, c) in buf {
118-
draw(x as i32 + x_shift, y as i32 + y_shift, c).map_err(|e| {
117+
draw(x as i32 + x_shift, y as i32 + y_shift, c).map_err(|_e| {
119118
// Note: If ever `plotters` adds a tracing or logging crate,
120119
// this would be a good place to use it.
121120
FontError::Unknown

0 commit comments

Comments
 (0)