rust-lang/rust-clippy

lint String::as_str()

Open

#874 opened on Apr 23, 2016

View on GitHub
 (9 comments) (0 reactions) (0 assignees)Rust (10,406 stars) (1,391 forks)batch import
A-lintT-middlegood first issue

Description

Using my_string.as_str() is noisy and adds no value in comparison to &my_string. This lint should not apply to using it in a .map(_) or some other higher-order stuff, just calling the function directly.

Contributor guide