Skip to content

identity_conversion: format!().into(): format macro is expanded #3360

Closed
@matthiaskrgr

Description

@matthiaskrgr

clippy 0.0.212 (5afdf8b 2018-10-14)

fn main() {
	let x = "world";
	let _: String = format!("Hello {}", x).into();
}

prints

warning: identical conversion
 --> src/main.rs:3:18
  |
3 |     let _: String = format!("Hello {}", x).into();
  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `$ crate :: fmt :: format ( format_args ! ( $ ( $ arg ) * ) )`
  |
  = note: #[warn(clippy::identity_conversion)] on by default
  = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#identity_conversion

can we not expand the macro in this case?

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingL-suggestionLint: Improving, adding or fixing lint suggestionsT-macrosType: Issues with macros and macro expansion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions