Skip to content

Commit 8becb0d

Browse files
authored
refactor crates for better api stability (#301)
1 parent 26a5af7 commit 8becb0d

File tree

23 files changed

+235
-638
lines changed

23 files changed

+235
-638
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[alias]
2+
lint = "hack --clean-per-run clippy --workspace --tests --examples"
3+
chk = "hack check --workspace --tests --examples"

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ members = [
1010
"actix-tracing",
1111
"actix-utils",
1212
"bytestring",
13+
"local-channel",
14+
"local-waker",
1315
]
1416

1517
[patch.crates-io]
@@ -23,3 +25,5 @@ actix-tls = { path = "actix-tls" }
2325
actix-tracing = { path = "actix-tracing" }
2426
actix-utils = { path = "actix-utils" }
2527
bytestring = { path = "bytestring" }
28+
local-channel = { path = "local-channel" }
29+
local-waker = { path = "local-waker" }

actix-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ syn = { version = "^1", features = ["full"] }
1919
[dev-dependencies]
2020
actix-rt = "2.0.0"
2121

22-
futures-util = { version = "0.3", default-features = false }
22+
futures-util = { version = "0.3.7", default-features = false }
2323
trybuild = "1"

actix-server/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ path = "src/lib.rs"
2222
default = []
2323

2424
[dependencies]
25-
actix-codec = "0.4.0-beta.1"
2625
actix-rt = { version = "2.0.0", default-features = false }
2726
actix-service = "2.0.0-beta.5"
2827
actix-utils = "3.0.0-beta.2"
@@ -35,7 +34,9 @@ slab = "0.4"
3534
tokio = { version = "1.2", features = ["sync"] }
3635

3736
[dev-dependencies]
37+
actix-codec = "0.4.0-beta.1"
3838
actix-rt = "2.0.0"
39+
3940
bytes = "1"
4041
env_logger = "0.8"
4142
futures-util = { version = "0.3.7", default-features = false, features = ["sink"] }

actix-server/tests/test_server.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use std::{net, thread, time};
44

55
use actix_server::Server;
66
use actix_service::fn_service;
7-
use futures_util::future::{lazy, ok};
7+
use actix_utils::future::ok;
8+
use futures_util::future::lazy;
89

910
fn unused_addr() -> net::SocketAddr {
1011
let addr: net::SocketAddr = "127.0.0.1:0".parse().unwrap();
@@ -30,6 +31,7 @@ fn test_bind() {
3031
.unwrap()
3132
.run()
3233
}));
34+
3335
let _ = tx.send((srv, actix_rt::System::current()));
3436
let _ = sys.run();
3537
});
@@ -175,6 +177,7 @@ fn test_configure() {
175177
.workers(1)
176178
.run()
177179
}));
180+
178181
let _ = tx.send((srv, actix_rt::System::current()));
179182
let _ = sys.run();
180183
});

actix-service/src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ mod tests {
147147

148148
forward_ready!(inner);
149149

150-
fn call(&self, req: ()) -> Self::Future {
151-
self.inner.call(req)
150+
fn call(&self, _: ()) -> Self::Future {
151+
self.inner.call(())
152152
}
153153
}
154154

actix-tracing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ path = "src/lib.rs"
1818
[dependencies]
1919
actix-service = "2.0.0-beta.5"
2020

21-
futures-util = { version = "0.3.4", default-features = false }
21+
futures-util = { version = "0.3.7", default-features = false }
2222
tracing = "0.1"
2323
tracing-futures = "0.2"
2424

actix-utils/CHANGES.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Changes
22

33
## Unreleased - 2021-xx-xx
4-
* Add `async fn mpsc::Receiver::recv`. [#286]
5-
* `SendError` inner field is now public. [#286]
6-
* Rename `Dispatcher::{get_sink => tx}`. [#286]
7-
* Rename `Dispatcher::{get_ref => service}`. [#286]
8-
* Rename `Dispatcher::{get_mut => service_mut}`. [#286]
9-
* Rename `Dispatcher::{get_framed => framed}`. [#286]
10-
* Rename `Dispatcher::{get_framed_mut => framed_mut}`. [#286]
11-
12-
[#286]: https://github.com/actix/actix-net/pull/286
4+
* Moved `mpsc` to own crate `local-channel`. [#301]
5+
* Moved `task::LocalWaker` to own crate `local-waker`. [#301]
6+
* Remove `timeout` module. [#301]
7+
* Remove `dispatcher` module. [#301]
8+
* Expose `future` mod with `ready` and `poll_fn` helpers. [#301]
9+
10+
[#301]: https://github.com/actix/actix-net/pull/301
1311

1412

1513
## 3.0.0-beta.2 - 2021-02-06

actix-utils/Cargo.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@ name = "actix_utils"
1616
path = "src/lib.rs"
1717

1818
[dependencies]
19-
actix-codec = "0.4.0-beta.1"
20-
actix-rt = { version = "2.0.0", default-features = false }
21-
actix-service = "2.0.0-beta.5"
22-
23-
futures-core = { version = "0.3.7", default-features = false }
24-
futures-sink = { version = "0.3.7", default-features = false }
25-
log = "0.4"
26-
pin-project-lite = "0.2.0"
19+
local-waker = "0.1"
2720

2821
[dev-dependencies]
2922
actix-rt = "2.0.0"

actix-utils/src/counter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use core::cell::Cell;
2-
use core::task;
1+
//! Task-notifying counter.
32
3+
use core::{cell::Cell, task};
44
use std::rc::Rc;
55

6-
use crate::task::LocalWaker;
6+
use local_waker::LocalWaker;
77

88
#[derive(Clone)]
99
/// Simple counter with ability to notify task on reaching specific number

0 commit comments

Comments
 (0)