Eliminate a few more futures dependencies.

This commit is contained in:
Blaž Hrastnik 2021-05-06 14:33:53 +09:00
parent 355ad3cb82
commit 1ad0581ddd
5 changed files with 13 additions and 67 deletions

60
Cargo.lock generated
View file

@ -185,54 +185,12 @@ dependencies = [
"new_debug_unreachable",
]
[[package]]
name = "futures"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9d5813545e459ad3ca1bff9915e9ad7f1a47dc6a91b627ce321d5863b7dd253"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-channel"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce79c6a52a299137a6013061e0cf0e688fce5d7f1bc60125f520912fdb29ec25"
dependencies = [
"futures-core",
"futures-sink",
]
[[package]]
name = "futures-core"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "098cd1c6dda6ca01650f1a37a794245eb73181d0d4d4e955e2f3c37db7af1815"
[[package]]
name = "futures-executor"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f6cb7042eda00f0049b1d2080aa4b93442997ee507eb3828e8bd7577f94c9d"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "365a1a1fb30ea1c03a830fdb2158f5236833ac81fa0ad12fe35b29cddc35cb04"
[[package]]
name = "futures-macro"
version = "0.3.14"
@ -245,12 +203,6 @@ dependencies = [
"syn",
]
[[package]]
name = "futures-sink"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c5629433c555de3d82861a7a4e3794a4c40040390907cfbfd7143a92a426c23"
[[package]]
name = "futures-task"
version = "0.3.14"
@ -263,13 +215,9 @@ version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c144ad54d60f23927f0a6b6d816e4271278b64f005ad65e4e35291d2de9c025"
dependencies = [
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project-lite",
"pin-utils",
"proc-macro-hack",
@ -405,7 +353,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"crossterm",
"futures-util",
"helix-core",
"helix-lsp",
"once_cell",
@ -491,11 +438,10 @@ dependencies = [
[[package]]
name = "jsonrpc-core"
version = "17.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07569945133257ff557eb37b015497104cea61a2c9edaf126c1cbd6e8332397f"
version = "17.1.0"
source = "git+https://github.com/paritytech/jsonrpc#609d7a6cc160742d035510fa89fb424ccf077660"
dependencies = [
"futures",
"futures-util",
"log",
"serde",
"serde_derive",

View file

@ -21,7 +21,8 @@ glob = "0.3"
anyhow = "1"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
jsonrpc-core = "17.0"
futures-util = "0.3"
# jsonrpc-core = { version = "17.1", default-features = false } # don't pull in all of futures
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", default-features = false } # don't pull in all of futures
futures-util = { version = "0.3", features = ["std", "async-await"] }
thiserror = "1.0"
log = "~0.4"

View file

@ -25,7 +25,7 @@ tui = { version = "0.15", default-features = false, features = ["crossterm"] }
crossterm = { version = "0.19", features = ["event-stream"] }
clap = { version = "3.0.0-beta.2 ", default-features = false, features = ["std", "cargo"] }
futures-util = "0.3"
futures-util = { version = "0.3", features = ["std", "async-await"] }
# Logging
fern = "0.6"

View file

@ -23,7 +23,6 @@ use crossterm::{
use tui::layout::Rect;
// use futures_util::future::BoxFuture;
use futures_util::stream::FuturesUnordered;
use std::pin::Pin;
@ -92,15 +91,16 @@ impl Application {
break;
}
use futures_util::{select, FutureExt, StreamExt};
select! {
event = reader.next().fuse() => {
use futures_util::StreamExt;
tokio::select! {
event = reader.next() => {
self.handle_terminal_events(event)
}
call = futures_util::StreamExt::select_next_some(&mut self.editor.language_servers.incoming) => {
Some(call) = self.editor.language_servers.incoming.next() => {
self.handle_language_server_message(call).await
}
callback = futures_util::StreamExt::select_next_some(&mut self.callbacks) => {
Some(callback) = &mut self.callbacks.next() => {
self.handle_language_server_callback(callback)
}
}

View file

@ -22,7 +22,6 @@ once_cell = "1.4"
url = "2"
tokio = { version = "1", features = ["full"] }
futures-util = "0.3"
slotmap = "1"