Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qarmin opened this issue Jan 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@qarmin
Copy link

qarmin commented Jan 18, 2024

To Reproduce

  • needs to enable in Cargo.toml featureab_glyph
use crate::pdf_creator::items::data::FONT_ROBOTO_REGULAR;
use plotters::style::register_font;
use plotters_backend::FontStyle;

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

@qarmin qarmin added the bug Something isn't working label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant