From 31d1bbfddb112a1e38cf974793afc427a3614ecf Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Wed, 21 Sep 2022 18:34:56 -0400 Subject: review comments --- helix-view/src/document.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'helix-view/src/document.rs') diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 4a09bedc..0774e516 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -554,12 +554,7 @@ impl Document { } }; - let identifier = if self.path().is_some() { - Some(self.identifier()) - } else { - None - }; - + let identifier = self.path().map(|_| self.identifier()); let language_server = self.language_server.clone(); // mark changes up to now as saved @@ -708,10 +703,7 @@ impl Document { /// and flushing through the queue of pending writes. If any fail, /// it stops early before emptying the rest of the queue. pub async fn close(&mut self) -> Option { - if self.save_sender.is_some() { - self.save_sender.take(); - } - + self.save_sender.take(); self.flush_saves_impl(true).await } -- cgit v1.2.3-70-g09d2