summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-06 08:20:00 +0000
committerBlaž Hrastnik2021-05-06 08:20:00 +0000
commitfd4fd12fa3dd565b56edb395bd625b0d2ec8ad46 (patch)
tree6c6ecf7777cb9eb7d9943122073a8a8e950abcbb
parentba970054957238cb682ae3be022b675131beb6f8 (diff)
clippy lint
-rw-r--r--helix-core/src/syntax.rs2
-rw-r--r--helix-lsp/src/client.rs2
-rw-r--r--helix-lsp/src/transport.rs4
-rw-r--r--helix-term/src/ui/menu.rs2
-rw-r--r--helix-term/src/ui/prompt.rs4
-rw-r--r--helix-view/src/editor.rs2
-rw-r--r--helix-view/src/theme.rs4
7 files changed, 10 insertions, 10 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 6e11e9b6..dbeed45c 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -841,7 +841,7 @@ impl HighlightConfiguration {
}
let highlight_indices = vec![None; query.capture_names().len()];
- Ok(HighlightConfiguration {
+ Ok(Self {
language,
query,
combined_injections_query,
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs
index 8de4b95a..8a3aabd9 100644
--- a/helix-lsp/src/client.rs
+++ b/helix-lsp/src/client.rs
@@ -61,7 +61,7 @@ impl Client {
let (incoming, outgoing) = Transport::start(reader, writer, stderr);
- let client = Client {
+ let client = Self {
_process: process,
outgoing,
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs
index 4a5ae45a..dd42f7bb 100644
--- a/helix-lsp/src/transport.rs
+++ b/helix-lsp/src/transport.rs
@@ -75,7 +75,7 @@ impl Transport {
}
async fn recv(
- reader: &mut (impl AsyncBufRead + Unpin),
+ reader: &mut (impl AsyncBufRead + Unpin + Send),
headers: &mut HashMap<String, String>,
) -> core::result::Result<Message, std::io::Error> {
// read headers
@@ -117,7 +117,7 @@ impl Transport {
}
async fn err(
- err: &mut (impl AsyncBufRead + Unpin),
+ err: &mut (impl AsyncBufRead + Unpin + Send),
) -> core::result::Result<(), std::io::Error> {
let mut line = String::new();
err.read_line(&mut line).await?;
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs
index 30ac044c..f8f6f269 100644
--- a/helix-term/src/ui/menu.rs
+++ b/helix-term/src/ui/menu.rs
@@ -258,7 +258,7 @@ impl<T: 'static> Component for Menu<T> {
let win_height = area.height as usize;
- fn div_ceil(a: usize, b: usize) -> usize {
+ const fn div_ceil(a: usize, b: usize) -> usize {
(a + b - 1) / a
}
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 04108d79..c59a0eed 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -31,8 +31,8 @@ impl Prompt {
prompt: String,
mut completion_fn: impl FnMut(&str) -> Vec<Completion> + 'static,
callback_fn: impl FnMut(&mut Editor, &str, PromptEvent) + 'static,
- ) -> Prompt {
- Prompt {
+ ) -> Self {
+ Self {
prompt,
line: String::new(),
cursor: 0,
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 44014e83..83208f78 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -30,7 +30,7 @@ impl Editor {
let toml = config
.as_deref()
.unwrap_or(include_bytes!("../../theme.toml"));
- let theme: Theme = toml::from_slice(&toml).expect("failed to parse theme.toml");
+ let theme: Theme = toml::from_slice(toml).expect("failed to parse theme.toml");
let language_servers = helix_lsp::Registry::new();
diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs
index ec7c746a..8b695898 100644
--- a/helix-view/src/theme.rs
+++ b/helix-view/src/theme.rs
@@ -92,7 +92,7 @@ pub struct Theme {
}
impl<'de> Deserialize<'de> for Theme {
- fn deserialize<D>(deserializer: D) -> Result<Theme, D::Error>
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
@@ -110,7 +110,7 @@ impl<'de> Deserialize<'de> for Theme {
}
let scopes = styles.keys().map(ToString::to_string).collect();
- Ok(Theme { scopes, styles })
+ Ok(Self { scopes, styles })
}
}