From e419c23769c1c0daf02006e1454bb7447bea3cd8 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 16 Jan 2025 20:29:43 -0600 Subject: [PATCH] repline: fix operator precedence bug, clippy lints --- repline/src/editor.rs | 4 ++-- repline/src/iter.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/repline/src/editor.rs b/repline/src/editor.rs index 6cecd9a..a8e19d1 100644 --- a/repline/src/editor.rs +++ b/repline/src/editor.rs @@ -302,7 +302,7 @@ impl<'a> Editor<'a> { } } -impl<'a, 'e> IntoIterator for &'e Editor<'a> { +impl<'e> IntoIterator for &'e Editor<'_> { type Item = &'e char; type IntoIter = std::iter::Chain< std::collections::vec_deque::Iter<'e, char>, @@ -313,7 +313,7 @@ impl<'a, 'e> IntoIterator for &'e Editor<'a> { } } -impl<'a> Display for Editor<'a> { +impl Display for Editor<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { use std::fmt::Write; for c in self.iter() { diff --git a/repline/src/iter.rs b/repline/src/iter.rs index 4af50bc..b57af60 100644 --- a/repline/src/iter.rs +++ b/repline/src/iter.rs @@ -39,7 +39,7 @@ pub mod chars { if cont & 0xc0 != 0x80 { return None; } - out = out << 6 | (cont & 0x3f); + out = (out << 6) | (cont & 0x3f); } Some(char::from_u32(out).ok_or(BadUnicode(out))) }