Skip to content

Remove clippy result_large_err in functions where CairoRunError is returned #2102

@FrancoGiachetta

Description

@FrancoGiachetta

With the recent update of rust's toolchain to 1.87.0, clippy has lowered the enum's variant maximum allowed size to 128 bytes. One of the variants of CairoRunError enum, VmException, is about 176 bytes. To prevent clippy from panicking, we placed a #[allow(clippy::result_large_err)] in functions where this enum is returned. However, we should tackle this properly. We could follow clippy's suggestion:

error: the `Err`-variant returned from this function is very large
   --> cairo-vm-cli/src/main.rs:169:47
    |
95  |     Runner(#[from] CairoRunError),
    |     ----------------------------- the largest variant contains at least 176 bytes
...
169 | fn run(args: impl Iterator<Item = String>) -> Result<(), Error> {
    |                                               ^^^^^^^^^^^^^^^^^
    |
    = help: try reducing the size of `Error`, for example by boxing large elements or replacing it with `Box<Error>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode chanegs aimed at improving maintainability or removing deprecated features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions