You can install clippy in two ways, as we did with the rustfmt tool: by adding the component using the rustup command or by installing the latest version from the GitHub repository of the project. To add it as a prebuilt component, use the following command:
rustup component add clippy
You also can install the latest version directly from the repository of the project using this command:
cargo install --git https://github.com/rust-lang/rust-clippy
But remember, this version is potentially unstable, and the lints it contains might be changed in the future.