From ebb40c7f87d58fb74c8f3b4dfcb2704140599d65 Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Sat, 15 Jun 2019 13:37:15 +0600 Subject: cargo format --- crates/gen_lsp_server/src/lib.rs | 3 +-- crates/gen_lsp_server/src/msg.rs | 3 +-- crates/ra_batch/src/lib.rs | 1 - crates/ra_lsp_server/src/main_loop.rs | 9 ++------- 4 files changed, 4 insertions(+), 12 deletions(-) (limited to 'crates') diff --git a/crates/gen_lsp_server/src/lib.rs b/crates/gen_lsp_server/src/lib.rs index 7c4fbbee4..8e7697ed4 100644 --- a/crates/gen_lsp_server/src/lib.rs +++ b/crates/gen_lsp_server/src/lib.rs @@ -127,8 +127,7 @@ fn initialize( sender.send(RawMessage::Response(resp)).unwrap(); match receiver.recv() { Ok(RawMessage::Notification(n)) => { - n.cast::() - .map_err(|_| "expected initialized notification")?; + n.cast::().map_err(|_| "expected initialized notification")?; } _ => Err(format!("expected initialized notification"))?, } diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs index 8138b84eb..2928e4f8b 100644 --- a/crates/gen_lsp_server/src/msg.rs +++ b/crates/gen_lsp_server/src/msg.rs @@ -182,8 +182,7 @@ fn read_msg_text(inp: &mut impl BufRead) -> Result> { } let mut parts = buf.splitn(2, ": "); let header_name = parts.next().unwrap(); - let header_value = - parts.next().ok_or_else(|| format!("malformed header: {:?}", buf))?; + let header_value = parts.next().ok_or_else(|| format!("malformed header: {:?}", buf))?; if header_name == "Content-Length" { size = Some(header_value.parse::()?); } diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index 35e783b14..96b32d9fe 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs @@ -2,7 +2,6 @@ mod vfs_filter; use std::{sync::Arc, path::Path, collections::HashSet, error::Error}; - use rustc_hash::FxHashMap; use ra_db::{ diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index fe6b360d4..aeb8a2299 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -399,8 +399,7 @@ fn on_notification( Ok(mut params) => { let uri = params.text_document.uri; let path = uri.to_file_path().map_err(|()| format!("invalid uri: {}", uri))?; - let text = - params.content_changes.pop().ok_or_else(|| format!("empty changes"))?.text; + let text = params.content_changes.pop().ok_or_else(|| format!("empty changes"))?.text; state.vfs.write().change_file_overlay(path.as_path(), text); return Ok(()); } @@ -548,11 +547,7 @@ where error: None, } } else { - RawResponse::err( - id, - ErrorCode::InternalError as i32, - e.to_string() - ) + RawResponse::err(id, ErrorCode::InternalError as i32, e.to_string()) } } }, -- cgit v1.2.3