on master help sign in
Eliminate a few more futures dependencies.
commit1ad0581ddd2d1fc6eb8b96b495eb4e546d4bdd28 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 6 May 2021, 14:33 (5 years ago) parent355ad3c
5 files changed+13−67
Cargo.lock+3−57 helix-lsp/Cargo.toml+3−2 helix-term/Cargo.toml+1−1 helix-term/src/application.rs+6−6 helix-view/Cargo.toml−1
Cargo.lock+3−57
@@ -185,54 +185,12 @@ dependencies = [
185185 "new_debug_unreachable",
186186]
187187
188−[[package]]
189−name = "futures"
190−version = "0.3.14"
191−source = "registry+https://github.com/rust-lang/crates.io-index"
192−checksum = "a9d5813545e459ad3ca1bff9915e9ad7f1a47dc6a91b627ce321d5863b7dd253"
193−dependencies = [
194− "futures-channel",
195− "futures-core",
196− "futures-executor",
197− "futures-io",
198− "futures-sink",
199− "futures-task",
200− "futures-util",
201−]
202−
203−[[package]]
204−name = "futures-channel"
205−version = "0.3.14"
206−source = "registry+https://github.com/rust-lang/crates.io-index"
207−checksum = "ce79c6a52a299137a6013061e0cf0e688fce5d7f1bc60125f520912fdb29ec25"
208−dependencies = [
209− "futures-core",
210− "futures-sink",
211−]
212−
213188[[package]]
214189name = "futures-core"
215190version = "0.3.14"
216191source = "registry+https://github.com/rust-lang/crates.io-index"
217192checksum = "098cd1c6dda6ca01650f1a37a794245eb73181d0d4d4e955e2f3c37db7af1815"
218193
219−[[package]]
220−name = "futures-executor"
221−version = "0.3.14"
222−source = "registry+https://github.com/rust-lang/crates.io-index"
223−checksum = "10f6cb7042eda00f0049b1d2080aa4b93442997ee507eb3828e8bd7577f94c9d"
224−dependencies = [
225− "futures-core",
226− "futures-task",
227− "futures-util",
228−]
229−
230−[[package]]
231−name = "futures-io"
232−version = "0.3.14"
233−source = "registry+https://github.com/rust-lang/crates.io-index"
234−checksum = "365a1a1fb30ea1c03a830fdb2158f5236833ac81fa0ad12fe35b29cddc35cb04"
235−
236194[[package]]
237195name = "futures-macro"
238196version = "0.3.14"
@@ -245,12 +203,6 @@ dependencies = [
245203 "syn",
246204]
247205
248−[[package]]
249−name = "futures-sink"
250−version = "0.3.14"
251−source = "registry+https://github.com/rust-lang/crates.io-index"
252−checksum = "5c5629433c555de3d82861a7a4e3794a4c40040390907cfbfd7143a92a426c23"
253−
254206[[package]]
255207name = "futures-task"
256208version = "0.3.14"
@@ -263,13 +215,9 @@ version = "0.3.14"
263215source = "registry+https://github.com/rust-lang/crates.io-index"
264216checksum = "3c144ad54d60f23927f0a6b6d816e4271278b64f005ad65e4e35291d2de9c025"
265217dependencies = [
266− "futures-channel",
267218 "futures-core",
268− "futures-io",
269219 "futures-macro",
270− "futures-sink",
271220 "futures-task",
272− "memchr",
273221 "pin-project-lite",
274222 "pin-utils",
275223 "proc-macro-hack",
@@ -405,7 +353,6 @@ version = "0.1.0"
405353dependencies = [
406354 "anyhow",
407355 "crossterm",
408− "futures-util",
409356 "helix-core",
410357 "helix-lsp",
411358 "once_cell",
@@ -491,11 +438,10 @@ dependencies = [
491438
492439[[package]]
493440name = "jsonrpc-core"
494−version = "17.0.0"
495−source = "registry+https://github.com/rust-lang/crates.io-index"
496−checksum = "07569945133257ff557eb37b015497104cea61a2c9edaf126c1cbd6e8332397f"
441+version = "17.1.0"
442+source = "git+https://github.com/paritytech/jsonrpc#609d7a6cc160742d035510fa89fb424ccf077660"
497443dependencies = [
498− "futures",
444+ "futures-util",
499445 "log",
500446 "serde",
501447 "serde_derive",
helix-lsp/Cargo.toml+3−2
@@ -21,7 +21,8 @@ glob = "0.3"
2121anyhow = "1"
2222serde_json = "1.0"
2323serde = { version = "1.0", features = ["derive"] }
24−jsonrpc-core = "17.0"
25−futures-util = "0.3"
24+# jsonrpc-core = { version = "17.1", default-features = false } # don't pull in all of futures
25+jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", default-features = false } # don't pull in all of futures
26+futures-util = { version = "0.3", features = ["std", "async-await"] }
2627thiserror = "1.0"
2728log = "~0.4"
helix-term/Cargo.toml+1−1
@@ -25,7 +25,7 @@ tui = { version = "0.15", default-features = false, features = ["crossterm"] }
2525crossterm = { version = "0.19", features = ["event-stream"] }
2626clap = { version = "3.0.0-beta.2 ", default-features = false, features = ["std", "cargo"] }
2727
28−futures-util = "0.3"
28+futures-util = { version = "0.3", features = ["std", "async-await"] }
2929
3030# Logging
3131fern = "0.6"
helix-term/src/application.rs+6−6
@@ -23,7 +23,6 @@ use crossterm::{
2323
2424use tui::layout::Rect;
2525
26−// use futures_util::future::BoxFuture;
2726use futures_util::stream::FuturesUnordered;
2827use std::pin::Pin;
2928
@@ -92,15 +91,16 @@ impl Application {
9291 break;
9392 }
9493
95− use futures_util::{select, FutureExt, StreamExt};
96− select! {
97− event = reader.next().fuse() => {
94+ use futures_util::StreamExt;
95+
96+ tokio::select! {
97+ event = reader.next() => {
9898 self.handle_terminal_events(event)
9999 }
100− call = futures_util::StreamExt::select_next_some(&mut self.editor.language_servers.incoming) => {
100+ Some(call) = self.editor.language_servers.incoming.next() => {
101101 self.handle_language_server_message(call).await
102102 }
103− callback = futures_util::StreamExt::select_next_some(&mut self.callbacks) => {
103+ Some(callback) = &mut self.callbacks.next() => {
104104 self.handle_language_server_callback(callback)
105105 }
106106 }
helix-view/Cargo.toml−1
@@ -22,7 +22,6 @@ once_cell = "1.4"
2222url = "2"
2323
2424tokio = { version = "1", features = ["full"] }
25−futures-util = "0.3"
2625
2726slotmap = "1"
2827