From 6344a7f362b19eaf71547766135ece160aa3389e Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Mon, 10 Aug 2020 15:05:01 +0300 Subject: Fix clippy warnings --- crates/ra_text_edit/src/lib.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'crates/ra_text_edit/src/lib.rs') diff --git a/crates/ra_text_edit/src/lib.rs b/crates/ra_text_edit/src/lib.rs index 25554f583..d68791cf1 100644 --- a/crates/ra_text_edit/src/lib.rs +++ b/crates/ra_text_edit/src/lib.rs @@ -76,10 +76,6 @@ impl TextEdit { self.indels.iter() } - pub fn into_iter(self) -> vec::IntoIter { - self.indels.into_iter() - } - pub fn apply(&self, text: &mut String) { match self.len() { 0 => return, @@ -141,6 +137,15 @@ impl TextEdit { } } +impl IntoIterator for TextEdit { + type Item = Indel; + type IntoIter = vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.indels.into_iter() + } +} + impl TextEditBuilder { pub fn replace(&mut self, range: TextRange, replace_with: String) { self.indels.push(Indel::replace(range, replace_with)) -- cgit v1.2.3