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

Fix issues reported by clippy #1336

Merged
merged 3 commits into from
Sep 11, 2022
Merged

Fix issues reported by clippy #1336

merged 3 commits into from
Sep 11, 2022

Commits on Sep 8, 2022

  1. Box compile error

    Running clippy against just, the vast majority of the errors are:
    
    ```
    error: the `Err`-variant returned from this function is very large
     --> src/unresolved_recipe.rs:9:8
      |
    9 |   ) -> CompileResult<'src, Recipe<'src>> {
      |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 144 bytes
      |
      = help: try reducing the size of `compile_error::CompileError<'src>`, for example by boxing large elements or replacing it with `Box<compile_error::CompileError<'src>>`
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err
    ```
    
    The large size of `CompileResult` is mostly caused by `CompileErrorKind`
    being a large type within `CompileError`. So, Box-ing that type on
    `CompileError` solves the `CompileResult` problem without requiring too
    many additional code changes.
    
    Most of the time, just will only be compiling one value of type
    `CompileResult`, which will hopefully most of the time not even have the
    error variant on it. So Boxing (part of) that variant in order to reduce
    the size of `CompileResult`, which will get passed between many
    different functions, makes sense.
    neunenak committed Sep 8, 2022
    Configuration menu
    Copy the full SHA
    20930eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0ad0bbd View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2022

  1. Configuration menu
    Copy the full SHA
    ffba068 View commit details
    Browse the repository at this point in the history