RS.CLIPPY.USELESS_CONVERSION

Calls to `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` which perform useless conversions to the same type

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: useless_conversion. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for Into, TryInto, From, TryFrom, or IntoIter calls which uselessly convert to the same type.

Why is this bad?

Redundant code.

Example

// format!() returns a `String`
let s: String = format!("hello").into();

Use instead:

let s: String = format!("hello");

Past names

  • identity_conversion