Merge pull request #2987 from aaudiber/address-build-warning

Address build warning
This commit is contained in:
Philipp Hansch 2018-08-01 08:23:33 +01:00 committed by GitHub
commit b60c887c13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1885,7 +1885,7 @@ fn lint_chars_last_cmp_with_unwrap<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, info: &
}
/// lint for length-1 `str`s for methods in `PATTERN_METHODS`
fn lint_single_char_pattern<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr, arg: &'tcx hir::Expr) {
fn lint_single_char_pattern<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, _expr: &'tcx hir::Expr, arg: &'tcx hir::Expr) {
if let Some((Constant::Str(r), _)) = constant(cx, cx.tables, arg) {
if r.len() == 1 {
let c = r.chars().next().unwrap();