diff options
author | Blaž Hrastnik | 2020-10-23 04:51:08 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-12-03 04:10:35 +0000 |
commit | eff6fac9ece0700f0ed8eb0a230b6816fa7cece7 (patch) | |
tree | 6f4121fb78ef93258f69aabbdf75e31dc8c5fdf9 | |
parent | f5981f72c256a834845aad0c2947a4a20fa84d1b (diff) |
clippy lint
-rw-r--r-- | helix-lsp/src/transport.rs | 3 | ||||
-rw-r--r-- | helix-view/src/document.rs | 2 | ||||
-rw-r--r-- | helix-view/src/editor.rs | 6 | ||||
-rw-r--r-- | helix-view/src/keymap.rs | 2 | ||||
-rw-r--r-- | helix-view/src/view.rs | 40 |
5 files changed, 30 insertions, 23 deletions
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs index 38c3bb57..b30a8a6e 100644 --- a/helix-lsp/src/transport.rs +++ b/helix-lsp/src/transport.rs @@ -138,11 +138,10 @@ impl Transport { // println!("<- {} {:?}", method, notification); self.incoming.send(notification).await?; } - Message::Call(call) => { + Message::Call(_call) => { // println!("<- {:?}", call); // dispatch } - _ => unreachable!(), }; Ok(()) } diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index a313b281..710ea4f8 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -164,4 +164,6 @@ impl Document { // pub fn slice<R>(&self, range: R) -> RopeSlice where R: RangeBounds { // self.state.doc.slice // } + + // TODO: transact(Fn) ? } diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 02199255..9fb2ae36 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -12,6 +12,12 @@ pub struct Editor { pub theme: Theme, // TODO: share one instance } +impl Default for Editor { + fn default() -> Self { + Self::new() + } +} + impl Editor { pub fn new() -> Self { let theme = Theme::default(); diff --git a/helix-view/src/keymap.rs b/helix-view/src/keymap.rs index 347e7d77..aaba34a6 100644 --- a/helix-view/src/keymap.rs +++ b/helix-view/src/keymap.rs @@ -1,6 +1,6 @@ use crate::commands::{self, Command}; use crate::document::Mode; -use helix_core::{hashmap, state}; +use helix_core::hashmap; use std::collections::HashMap; // Kakoune-inspired: diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index 4cf6a2ee..df41e3ae 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -86,24 +86,24 @@ impl View { Some(Position::new(row, col)) } - pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F) - where - F: Fn(usize, usize), - { - let start = self.screen_coords_at_pos(text, start); - let end = self.screen_coords_at_pos(text, end); - - match (start, end) { - // fully on screen - (Some(start), Some(end)) => { - // we want to calculate ends of lines for each char.. - } - // from start to end of screen - (Some(start), None) => {} - // from start of screen to end - (None, Some(end)) => {} - // not on screen - (None, None) => return, - } - } + // pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F) + // where + // F: Fn(usize, usize), + // { + // let start = self.screen_coords_at_pos(text, start); + // let end = self.screen_coords_at_pos(text, end); + + // match (start, end) { + // // fully on screen + // (Some(start), Some(end)) => { + // // we want to calculate ends of lines for each char.. + // } + // // from start to end of screen + // (Some(start), None) => {} + // // from start of screen to end + // (None, Some(end)) => {} + // // not on screen + // (None, None) => return, + // } + // } } |