Skip to content

Commit a8a42d7

Browse files
committed
feat(smol): reorganize exports
1 parent 4d232b8 commit a8a42d7

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

areq-smol/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ futures-lite = { workspace = true, features = ["std"] }
2424
url.workspace = true
2525

2626
[dev-dependencies]
27+
areq = { workspace = true, features = ["http1", "rtn"] }
2728
async-executor.workspace = true
2829

2930
[lints]

areq-smol/src/connect.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {
1919
///
2020
/// ```
2121
/// use {
22-
/// areq_smol::{areq::{http::Uri, http1::Http1}, prelude::*},
22+
/// areq_smol::{http::Uri, http1::Http1, prelude::*},
2323
/// async_executor::Executor,
2424
/// std::io::Error,
2525
/// };
@@ -40,13 +40,13 @@ use {
4040
/// }
4141
/// ```
4242
///
43-
/// You can also use an extension method [`handle`](crate::Handle::handle),
43+
/// You can also use an extension method [`handle`](crate::smol::Handle::handle),
4444
/// which takes an async closure, calls it on the client, and polls the task
4545
/// in background for the entire duration of the closure execution.
4646
///
4747
/// ```
4848
/// use {
49-
/// areq_smol::{areq::{http::Uri, http1::Http1}, prelude::*},
49+
/// areq_smol::{http::Uri, http1::Http1, prelude::*},
5050
/// std::io::Error,
5151
/// };
5252
///

areq-smol/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
mod connect;
55
mod handle;
66

7+
/// Smol related traits.
8+
pub mod smol {
9+
pub use crate::{connect::Connect, handle::Handle};
10+
}
11+
712
/// The crate's prelude.
813
pub mod prelude {
914
pub use {
10-
crate::{Connect as _, Handle as _},
15+
crate::{smol::Connect as _, smol::Handle as _},
1116
areq::prelude::*,
1217
};
1318
}
1419

15-
/// Base `areq` crate.
16-
pub mod areq {
17-
pub use areq::*;
18-
}
19-
20-
pub use crate::{connect::Connect, handle::Handle};
20+
pub use areq::*;

examples/hello-smol/src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
fn main() {
22
use {
3-
areq_smol::{
4-
areq::{http::Uri, http1::Http1},
5-
prelude::*,
6-
},
3+
areq_smol::{http::Uri, http1::Http1, prelude::*},
74
async_executor::Executor,
85
std::io::Error,
96
};

0 commit comments

Comments
 (0)