Skip to content

Commit eda8d82

Browse files
committed
use starts_with() instead of chars().next() == Some(x)
1 parent 360e42d commit eda8d82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_typeck/check/demand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
526526
// we may want to suggest removing a `&`.
527527
if !sm.span_to_filename(expr.span).is_real() {
528528
if let Ok(code) = sm.span_to_snippet(sp) {
529-
if code.chars().next() == Some('&') {
529+
if code.starts_with('&') {
530530
return Some((
531531
sp,
532532
"consider removing the borrow",

0 commit comments

Comments
 (0)