Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 7ec4b12

Browse files
authored
Merge pull request #1478 from matthiaskrgr/clippy_4
fix a couple of clippy/rustc warnings
2 parents bfee4d2 + 1af417e commit 7ec4b12

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

Cargo.lock

Lines changed: 23 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rls-vfs = "0.8"
3131

3232
cargo = { git = "https://github.com/rust-lang/cargo", rev = "d56af31df1fbe45105ccd3b633297b2bc61e7405" }
3333
cargo_metadata = "0.7"
34-
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "60a609acaed3bf2b3ec6ab995bccf0f03bc26060", optional = true }
34+
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "71be6f62fa920c0bd10cdf3a29aeb8c6719a8075", optional = true }
3535
env_logger = "0.6"
3636
failure = "0.1.1"
3737
home = "0.3"

rls/src/actions/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ impl Rustfmt {
9292

9393
// Rustfmt represents an added line as start_line == end_line, new_text == "",
9494
// which is a no-op, so we need to add a terminating newline.
95-
if start_line == end_line && new_text.len() == 0 {
95+
if start_line == end_line && new_text.is_empty() {
9696
new_text.push_str(newline);
9797
}
9898

9999
// Line deletions are represented as start_line != end_line, new_text == "".
100100
// If we're not deleting a line, there should always be a terminating newline.
101-
let delete_only = start_line != end_line && new_text.len() == 0;
101+
let delete_only = start_line != end_line && new_text.is_empty();
102102
if !delete_only && !new_text.ends_with(newline) {
103103
new_text.push_str(newline);
104104
}

tests/support/client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod child_process;
4040
// however we only call `Runtime::block_on` and whenever we do it, there are no
4141
// active borrows in scope.
4242
type Messages = Rc<RefCell<Vec<Value>>>;
43-
type Channels = Rc<RefCell<Vec<(Box<Fn(&Value) -> bool>, oneshot::Sender<Value>)>>>;
43+
type Channels = Rc<RefCell<Vec<(Box<dyn Fn(&Value) -> bool>, oneshot::Sender<Value>)>>>;
4444

4545
type LspFramed<T> = tokio::codec::Framed<T, LspCodec>;
4646

0 commit comments

Comments
 (0)