use starts_with() instead of chars().next() == Some(x)

This commit is contained in:
Matthias Krüger
2020-03-01 20:03:56 +01:00
parent 360e42de82
commit eda8d82b95
+1 -1
View File
@@ -526,7 +526,7 @@ pub fn check_ref(
// we may want to suggest removing a `&`.
if !sm.span_to_filename(expr.span).is_real() {
if let Ok(code) = sm.span_to_snippet(sp) {
if code.chars().next() == Some('&') {
if code.starts_with('&') {
return Some((
sp,
"consider removing the borrow",