on master help sign in
clippy lint
commitfd4fd12fa3dd565b56edb395bd625b0d2ec8ad46 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 6 May 2021, 17:20 (5 years ago) parentba97005
7 files changed+10−10
helix-core/src/syntax.rs+1−1 helix-lsp/src/client.rs+1−1 helix-lsp/src/transport.rs+2−2 helix-term/src/ui/menu.rs+1−1 helix-term/src/ui/prompt.rs+2−2 helix-view/src/editor.rs+1−1 helix-view/src/theme.rs+2−2
helix-core/src/syntax.rs+1−1
@@ -841,7 +841,7 @@ impl HighlightConfiguration {
841841 }
842842
843843 let highlight_indices = vec![None; query.capture_names().len()];
844− Ok(HighlightConfiguration {
844+ Ok(Self {
845845 language,
846846 query,
847847 combined_injections_query,
helix-lsp/src/client.rs+1−1
@@ -61,7 +61,7 @@ impl Client {
6161
6262 let (incoming, outgoing) = Transport::start(reader, writer, stderr);
6363
64− let client = Client {
64+ let client = Self {
6565 _process: process,
6666
6767 outgoing,
helix-lsp/src/transport.rs+2−2
@@ -75,7 +75,7 @@ impl Transport {
7575 }
7676
7777 async fn recv(
78− reader: &mut (impl AsyncBufRead + Unpin),
78+ reader: &mut (impl AsyncBufRead + Unpin + Send),
7979 headers: &mut HashMap<String, String>,
8080 ) -> core::result::Result<Message, std::io::Error> {
8181 // read headers
@@ -117,7 +117,7 @@ impl Transport {
117117 }
118118
119119 async fn err(
120− err: &mut (impl AsyncBufRead + Unpin),
120+ err: &mut (impl AsyncBufRead + Unpin + Send),
121121 ) -> core::result::Result<(), std::io::Error> {
122122 let mut line = String::new();
123123 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> {
258258
259259 let win_height = area.height as usize;
260260
261− fn div_ceil(a: usize, b: usize) -> usize {
261+ const fn div_ceil(a: usize, b: usize) -> usize {
262262 (a + b - 1) / a
263263 }
264264
helix-term/src/ui/prompt.rs+2−2
@@ -31,8 +31,8 @@ impl Prompt {
3131 prompt: String,
3232 mut completion_fn: impl FnMut(&str) -> Vec<Completion> + 'static,
3333 callback_fn: impl FnMut(&mut Editor, &str, PromptEvent) + 'static,
34− ) -> Prompt {
35− Prompt {
34+ ) -> Self {
35+ Self {
3636 prompt,
3737 line: String::new(),
3838 cursor: 0,
helix-view/src/editor.rs+1−1
@@ -30,7 +30,7 @@ impl Editor {
3030 let toml = config
3131 .as_deref()
3232 .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");
3434
3535 let language_servers = helix_lsp::Registry::new();
3636
helix-view/src/theme.rs+2−2
@@ -92,7 +92,7 @@ pub struct Theme {
9292}
9393
9494impl<'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>
9696 where
9797 D: Deserializer<'de>,
9898 {
@@ -110,7 +110,7 @@ impl<'de> Deserialize<'de> for Theme {
110110 }
111111
112112 let scopes = styles.keys().map(ToString::to_string).collect();
113− Ok(Theme { scopes, styles })
113+ Ok(Self { scopes, styles })
114114 }
115115}
116116