Skip to content

Rename field mod::common::contexts::torrent::responses::Category::category_id to id to avoid Clippy error #388

@josecelano

Description

@josecelano

Clippy lints: https://rust-lang.github.io/rust-clippy/master/index.html#/struct_field_names

This is the current code:

#[rustversion::stable]
#[derive(Deserialize, PartialEq, Debug)]
pub struct Category {
    pub category_id: CategoryId, // todo: rename to `id`
    pub name: String,
    pub num_torrents: u64,
}

#[rustversion::nightly]
#[derive(Deserialize, PartialEq, Debug)]
#[allow(clippy::struct_field_names)]
pub struct Category {
    pub category_id: CategoryId, // todo: rename to `id`
    pub name: String,
    pub num_torrents: u64,
}

The field category_id should not be prefixed with the struct name.

NOTICE: the frontend type is also using the same name. So It must also be refactored there.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions