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

BugFix: Error propagation is silenced #511

Merged
merged 3 commits into from
Oct 18, 2023

Commits on Oct 17, 2023

  1. Error propagation is silenced

    ```
    warning: unused `Result` that must be used
       --> plotters/src/style/font/ttf.rs:135:9
        |
    135 | /         data.clone().map(|handle| {
    136 | |             handle
    137 | |                 .load()
    138 | |                 .map(FontExt::new)
    139 | |                 .map_err(|e| FontError::FontLoadError(Arc::new(e)))
    140 | |         })?;
        | |___________^
        |
        = note: this `Result` may be an `Err` variant, which should be handled
        = note: `#[warn(unused_must_use)]` on by default
    help: use `let _ = ...` to ignore the resulting value
        |
    135 |         let _ = data.clone().map(|handle| {
    ```
    
    When I remove the ? and look at the type of the droppped variable
    I see that is it Result<Result<FontExt, FontError>, FontError>
    
    Rust is very unintuative on this matter. The solution is to double
    unwrap.
    
    There are many ways to do this .. I went with a soltions I think is readable.
    martinfrances107 committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    33257bf View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. Configuration menu
    Copy the full SHA
    4ac399e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    787968c View commit details
    Browse the repository at this point in the history