mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-01 04:27:38 +00:00
use starts_with() instead of chars().next() == Some(x)
This commit is contained in:
parent
360e42de82
commit
eda8d82b95
@ -526,7 +526,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
// we may want to suggest removing a `&`.
|
// we may want to suggest removing a `&`.
|
||||||
if !sm.span_to_filename(expr.span).is_real() {
|
if !sm.span_to_filename(expr.span).is_real() {
|
||||||
if let Ok(code) = sm.span_to_snippet(sp) {
|
if let Ok(code) = sm.span_to_snippet(sp) {
|
||||||
if code.chars().next() == Some('&') {
|
if code.starts_with('&') {
|
||||||
return Some((
|
return Some((
|
||||||
sp,
|
sp,
|
||||||
"consider removing the borrow",
|
"consider removing the borrow",
|
||||||
|
Loading…
Reference in New Issue
Block a user