on master help sign in
clippy lint
fd4fd12Blaž Hrastnik
helix-core/src/syntax.rs+1−1
@@ -841,7 +841,7 @@ impl HighlightConfiguration {
841 }
841 }
842
842
843 let highlight_indices = vec![None; query.capture_names().len()];
843 let highlight_indices = vec![None; query.capture_names().len()];
844− Ok(HighlightConfiguration {
844+ Ok(Self {
845 language,
845 language,
846 query,
846 query,
847 combined_injections_query,
847 combined_injections_query,
helix-lsp/src/client.rs+1−1
@@ -61,7 +61,7 @@ impl Client {
61
61
62 let (incoming, outgoing) = Transport::start(reader, writer, stderr);
62 let (incoming, outgoing) = Transport::start(reader, writer, stderr);
63
63
64− let client = Client {
64+ let client = Self {
65 _process: process,
65 _process: process,
66
66
67 outgoing,
67 outgoing,
helix-lsp/src/transport.rs+2−2
@@ -75,7 +75,7 @@ impl Transport {
75 }
75 }
76
76
77 async fn recv(
77 async fn recv(
78− reader: &mut (impl AsyncBufRead + Unpin),
78+ reader: &mut (impl AsyncBufRead + Unpin + Send),
79 headers: &mut HashMap<String, String>,
79 headers: &mut HashMap<String, String>,
80 ) -> core::result::Result<Message, std::io::Error> {
80 ) -> core::result::Result<Message, std::io::Error> {
81 // read headers
81 // read headers
@@ -117,7 +117,7 @@ impl Transport {
117 }
117 }
118
118
119 async fn err(
119 async fn err(
120− err: &mut (impl AsyncBufRead + Unpin),
120+ err: &mut (impl AsyncBufRead + Unpin + Send),
121 ) -> core::result::Result<(), std::io::Error> {
121 ) -> core::result::Result<(), std::io::Error> {
122 let mut line = String::new();
122 let mut line = String::new();
123 err.read_line(&mut line).await?;
123 err.read_line(&mut line).await?;
helix-term/src/ui/menu.rs+1−1
@@ -258,7 +258,7 @@ impl<T: 'static> Component for Menu<T> {
258
258
259 let win_height = area.height as usize;
259 let win_height = area.height as usize;
260
260
261− fn div_ceil(a: usize, b: usize) -> usize {
261+ const fn div_ceil(a: usize, b: usize) -> usize {
262 (a + b - 1) / a
262 (a + b - 1) / a
263 }
263 }
264
264
helix-term/src/ui/prompt.rs+2−2
@@ -31,8 +31,8 @@ impl Prompt {
31 prompt: String,
31 prompt: String,
32 mut completion_fn: impl FnMut(&str) -> Vec<Completion> + 'static,
32 mut completion_fn: impl FnMut(&str) -> Vec<Completion> + 'static,
33 callback_fn: impl FnMut(&mut Editor, &str, PromptEvent) + 'static,
33 callback_fn: impl FnMut(&mut Editor, &str, PromptEvent) + 'static,
34− ) -> Prompt {
34+ ) -> Self {
35− Prompt {
35+ Self {
36 prompt,
36 prompt,
37 line: String::new(),
37 line: String::new(),
38 cursor: 0,
38 cursor: 0,
helix-view/src/editor.rs+1−1
@@ -30,7 +30,7 @@ impl Editor {
30 let toml = config
30 let toml = config
31 .as_deref()
31 .as_deref()
32 .unwrap_or(include_bytes!("../../theme.toml"));
32 .unwrap_or(include_bytes!("../../theme.toml"));
33− let theme: Theme = toml::from_slice(&toml).expect("failed to parse theme.toml");
33+ let theme: Theme = toml::from_slice(toml).expect("failed to parse theme.toml");
34
34
35 let language_servers = helix_lsp::Registry::new();
35 let language_servers = helix_lsp::Registry::new();
36
36
helix-view/src/theme.rs+2−2
@@ -92,7 +92,7 @@ pub struct Theme {
92}
92}
93
93
94impl<'de> Deserialize<'de> for Theme {
94impl<'de> Deserialize<'de> for Theme {
95− fn deserialize<D>(deserializer: D) -> Result<Theme, D::Error>
95+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
96 where
96 where
97 D: Deserializer<'de>,
97 D: Deserializer<'de>,
98 {
98 {
@@ -110,7 +110,7 @@ impl<'de> Deserialize<'de> for Theme {
110 }
110 }
111
111
112 let scopes = styles.keys().map(ToString::to_string).collect();
112 let scopes = styles.keys().map(ToString::to_string).collect();
113− Ok(Theme { scopes, styles })
113+ Ok(Self { scopes, styles })
114 }
114 }
115}
115}
116
116