meilisearch / meilisearch-rust

Rust wrapper for the Meilisearch API.

Home Page:https://www.meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clippy error on struct size introduced by new rust version

bidoubiwa opened this issue · comments

Since the last release of rust, a new clippy error is introduced checking the size of the structures.

See this issue: rust-lang/rust-clippy#9538

These are expected to be less than 200bytes

For example:

251 |     pub fn try_make_index(self, client: &Client) -> Result<Index, Self> {
    |                                                     ^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 200 bytes

We should find a way to fix this error by boxing the correct structures/fields.

After discussing with @irevoire , we are going to add an attribute to silence the error whenever it shows up. See example:

#[allow(clippy::result_large_err)] // Since `self` has been consumed, this is not an issue

Fixed with clippy update