clippy lint

pull/11/head
Blaž Hrastnik 4 years ago
parent ba97005495
commit fd4fd12fa3

@ -841,7 +841,7 @@ impl HighlightConfiguration {
} }
let highlight_indices = vec![None; query.capture_names().len()]; let highlight_indices = vec![None; query.capture_names().len()];
Ok(HighlightConfiguration { Ok(Self {
language, language,
query, query,
combined_injections_query, combined_injections_query,

@ -61,7 +61,7 @@ impl Client {
let (incoming, outgoing) = Transport::start(reader, writer, stderr); let (incoming, outgoing) = Transport::start(reader, writer, stderr);
let client = Client { let client = Self {
_process: process, _process: process,
outgoing, outgoing,

@ -75,7 +75,7 @@ impl Transport {
} }
async fn recv( async fn recv(
reader: &mut (impl AsyncBufRead + Unpin), reader: &mut (impl AsyncBufRead + Unpin + Send),
headers: &mut HashMap<String, String>, headers: &mut HashMap<String, String>,
) -> core::result::Result<Message, std::io::Error> { ) -> core::result::Result<Message, std::io::Error> {
// read headers // read headers
@ -117,7 +117,7 @@ impl Transport {
} }
async fn err( async fn err(
err: &mut (impl AsyncBufRead + Unpin), err: &mut (impl AsyncBufRead + Unpin + Send),
) -> core::result::Result<(), std::io::Error> { ) -> core::result::Result<(), std::io::Error> {
let mut line = String::new(); let mut line = String::new();
err.read_line(&mut line).await?; err.read_line(&mut line).await?;

@ -258,7 +258,7 @@ impl<T: 'static> Component for Menu<T> {
let win_height = area.height as usize; 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 (a + b - 1) / a
} }

@ -31,8 +31,8 @@ impl Prompt {
prompt: String, prompt: String,
mut completion_fn: impl FnMut(&str) -> Vec<Completion> + 'static, mut completion_fn: impl FnMut(&str) -> Vec<Completion> + 'static,
callback_fn: impl FnMut(&mut Editor, &str, PromptEvent) + 'static, callback_fn: impl FnMut(&mut Editor, &str, PromptEvent) + 'static,
) -> Prompt { ) -> Self {
Prompt { Self {
prompt, prompt,
line: String::new(), line: String::new(),
cursor: 0, cursor: 0,

@ -30,7 +30,7 @@ impl Editor {
let toml = config let toml = config
.as_deref() .as_deref()
.unwrap_or(include_bytes!("../../theme.toml")); .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(); let language_servers = helix_lsp::Registry::new();

@ -92,7 +92,7 @@ pub struct Theme {
} }
impl<'de> Deserialize<'de> for 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 where
D: Deserializer<'de>, D: Deserializer<'de>,
{ {
@ -110,7 +110,7 @@ impl<'de> Deserialize<'de> for Theme {
} }
let scopes = styles.keys().map(ToString::to_string).collect(); let scopes = styles.keys().map(ToString::to_string).collect();
Ok(Theme { scopes, styles }) Ok(Self { scopes, styles })
} }
} }

Loading…
Cancel
Save