From 61f3a438d3a729a6be941bca1ff4c6a97a33f221 Mon Sep 17 00:00:00 2001 From: "Jeremy A. Kolb" Date: Mon, 15 Oct 2018 17:44:23 -0400 Subject: Cargo Format Run `cargo fmt` and ignore generated files --- crates/ra_editor/src/edit.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'crates/ra_editor/src/edit.rs') diff --git a/crates/ra_editor/src/edit.rs b/crates/ra_editor/src/edit.rs index 46e687319..c3149ec54 100644 --- a/crates/ra_editor/src/edit.rs +++ b/crates/ra_editor/src/edit.rs @@ -1,8 +1,5 @@ use crate::{TextRange, TextUnit}; -use ra_syntax::{ - AtomEdit, - text_utils::contains_offset_nonstrict, -}; +use ra_syntax::{text_utils::contains_offset_nonstrict, AtomEdit}; #[derive(Debug, Clone)] pub struct Edit { @@ -11,7 +8,7 @@ pub struct Edit { #[derive(Debug)] pub struct EditBuilder { - atoms: Vec + atoms: Vec, } impl EditBuilder { @@ -36,7 +33,9 @@ impl EditBuilder { Edit { atoms } } pub fn invalidates_offset(&self, offset: TextUnit) -> bool { - self.atoms.iter().any(|atom| contains_offset_nonstrict(atom.delete, offset)) + self.atoms + .iter() + .any(|atom| contains_offset_nonstrict(atom.delete, offset)) } } @@ -74,7 +73,7 @@ impl Edit { break; } if offset < atom.delete.end() { - return None + return None; } res += TextUnit::of_str(&atom.insert); res -= atom.delete.len(); -- cgit v1.2.3