plotters-rs / plotters

A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀
https://plotters-rs.github.io/home/
MIT License
3.89k stars 281 forks source link

[BUG] InvalidFont not implements Debug, so Result<(), InvalidFont> cannot be unwrapped #539

Open qarmin opened 10 months ago

qarmin commented 10 months ago

To Reproduce

pub fn register_pdf_fonts() { register_font("roboto-regular", FontStyle::Normal, FONT_ROBOTO_REGULAR).unwrap(); }

produce error:
error[E0277]: style::font::ab_glyph::InvalidFont doesn't implement std::fmt::Debug --> src/pdf_creator/init.rs:6:77 6 register_font("roboto-regular", FontStyle::Normal, FONT_ROBOTO_REGULAR).unwrap(); ^^^^^^ style::font::ab_glyph::InvalidFont cannot be formatted using {:?} because it doesn't implement std::fmt::Debug
 = help: the trait `std::fmt::Debug` is not implemented for `style::font::ab_glyph::InvalidFont`

note: required by a bound in Result::<T, E>::unwrap --> /home/rafal/.rustup/toolchains/1.72.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1072:12 | 1070 | pub fn unwrap(self) -> T | ------ required by a bound in this associated function 1071 | where 1072 | E: fmt::Debug, | ^^^^^^^^^^ required by this bound in Result::<T, E>::unwrap



**Version Information**
0.3.5