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

clippy: Fix lint about TryFrom & TryInto #248

Conversation

hackaugusto
Copy link
Contributor

The 2021 prelude includes TryFrom and TryInto [1]. And recently the nigtlhy channel started linting for this duplicated imports and emitting warnings. This removes the redundant imports.

1: https://doc.rust-lang.org/core/prelude/rust_2021/index.html


Here is an example warning:

warning: the item `TryInto` is imported redundantly
   --> examples/src/lamport/signature.rs:8:26
    |
8   | use std::{cmp::Ordering, convert::TryInto};
    |                          ^^^^^^^^^^^^^^^^
    |
   ::: /Users/hack/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13
    |
129 |     pub use core::prelude::rust_2021::*;
    |             ------------------------ the item `TryInto` is already defined here
    |
    = note: `#[warn(unused_imports)]` on by default

The 2021 prelude includes TryFrom and TryInto [1]. And recently the
nigtlhy channel started linting for this duplicated imports and emitting
warnings. This removes the redundant imports.

1: https://doc.rust-lang.org/core/prelude/rust_2021/index.html
@hackaugusto
Copy link
Contributor Author

The CI failure is related, in the sense the warnings seem to have started with the same change for TryFrom and TryInto. However, those require additional changes from std/no_std support, and I will fix in a follow up.

@irakliyk
Copy link
Collaborator

Closing this as these changes were also included in #250.

@irakliyk irakliyk closed this Feb 21, 2024
@hackaugusto hackaugusto deleted the hacka-fix-tryfrom-tryinto-warnings branch February 22, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants