Skip to content

Commit 4f3c729

Browse files
committed
Merge #421: bitreq: Remove unused tokio features
61518d5 Update lockfiles (Jamil Lambert, PhD) 7ccb3dc Remove unused tokio features (Jamil Lambert, PhD) 261aca2 Update async example to not need tokio features (Jamil Lambert, PhD) Pull request description: There are tokio features that are not used in the crate, or only used in an example. Update the example so that it doesn't require any additional tokio features that the rest of the crate doesn't use. Remove the unused tokio features. Addresses one of the points in #402. Update the lock files. ACKs for top commit: tcharding: ACK 61518d5 Tree-SHA512: c30fe1b31992eb7d08c8da0ac0289f5509102c19429f9432359d00a0f2a891a3fe889f86ec796db41600dcb72b8cc59f295d6ddbd553d0c805615170454f2356
2 parents 0cf29f9 + 61518d5 commit 4f3c729

File tree

4 files changed

+12
-89
lines changed

4 files changed

+12
-89
lines changed

Cargo-minimal.lock

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ version = "1.5.0"
186186
source = "registry+https://github.com/rust-lang/crates.io-index"
187187
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
188188

189-
[[package]]
190-
name = "bytes"
191-
version = "1.10.1"
192-
source = "registry+https://github.com/rust-lang/crates.io-index"
193-
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
194-
195189
[[package]]
196190
name = "bzip2"
197191
version = "0.4.4"
@@ -381,12 +375,6 @@ version = "0.32.3"
381375
source = "registry+https://github.com/rust-lang/crates.io-index"
382376
checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
383377

384-
[[package]]
385-
name = "hermit-abi"
386-
version = "0.3.9"
387-
source = "registry+https://github.com/rust-lang/crates.io-index"
388-
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
389-
390378
[[package]]
391379
name = "hex-conservative"
392380
version = "0.2.1"
@@ -503,18 +491,6 @@ dependencies = [
503491
"adler2",
504492
]
505493

506-
[[package]]
507-
name = "mio"
508-
version = "1.0.2"
509-
source = "registry+https://github.com/rust-lang/crates.io-index"
510-
checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec"
511-
dependencies = [
512-
"hermit-abi",
513-
"libc",
514-
"wasi",
515-
"windows-sys 0.52.0",
516-
]
517-
518494
[[package]]
519495
name = "num-traits"
520496
version = "0.2.19"
@@ -778,16 +754,6 @@ version = "1.3.0"
778754
source = "registry+https://github.com/rust-lang/crates.io-index"
779755
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
780756

781-
[[package]]
782-
name = "socket2"
783-
version = "0.5.8"
784-
source = "registry+https://github.com/rust-lang/crates.io-index"
785-
checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8"
786-
dependencies = [
787-
"libc",
788-
"windows-sys 0.52.0",
789-
]
790-
791757
[[package]]
792758
name = "socks"
793759
version = "0.3.4"
@@ -859,24 +825,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
859825
checksum = "2209a14885b74764cce87ffa777ffa1b8ce81a3f3166c6f886b83337fe7e077f"
860826
dependencies = [
861827
"backtrace",
862-
"bytes",
863-
"libc",
864-
"mio",
865828
"pin-project-lite",
866-
"socket2",
867-
"tokio-macros",
868-
"windows-sys 0.52.0",
869-
]
870-
871-
[[package]]
872-
name = "tokio-macros"
873-
version = "2.4.0"
874-
source = "registry+https://github.com/rust-lang/crates.io-index"
875-
checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
876-
dependencies = [
877-
"proc-macro2",
878-
"quote",
879-
"syn",
880829
]
881830

882831
[[package]]

Cargo-recent.lock

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ version = "1.5.0"
186186
source = "registry+https://github.com/rust-lang/crates.io-index"
187187
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
188188

189-
[[package]]
190-
name = "bytes"
191-
version = "1.10.1"
192-
source = "registry+https://github.com/rust-lang/crates.io-index"
193-
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
194-
195189
[[package]]
196190
name = "bzip2"
197191
version = "0.4.4"
@@ -789,16 +783,6 @@ version = "0.4.11"
789783
source = "registry+https://github.com/rust-lang/crates.io-index"
790784
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
791785

792-
[[package]]
793-
name = "socket2"
794-
version = "0.5.8"
795-
source = "registry+https://github.com/rust-lang/crates.io-index"
796-
checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8"
797-
dependencies = [
798-
"libc",
799-
"windows-sys 0.52.0",
800-
]
801-
802786
[[package]]
803787
name = "socks"
804788
version = "0.3.4"
@@ -870,26 +854,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
870854
checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
871855
dependencies = [
872856
"backtrace",
873-
"bytes",
874857
"io-uring",
875858
"libc",
876859
"mio",
877860
"pin-project-lite",
878861
"slab",
879-
"socket2",
880-
"tokio-macros",
881-
"windows-sys 0.52.0",
882-
]
883-
884-
[[package]]
885-
name = "tokio-macros"
886-
version = "2.5.0"
887-
source = "registry+https://github.com/rust-lang/crates.io-index"
888-
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
889-
dependencies = [
890-
"proc-macro2",
891-
"quote",
892-
"syn",
893862
]
894863

895864
[[package]]

bitreq/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ webpki-roots = { version = "0.25.2", optional = true }
3232
rustls-webpki = { version = "0.101.0", optional = true }
3333
log = { version = "0.4.0", optional = true }
3434
# For the async feature:
35-
tokio = { version = "1.0", features = ["net", "time", "io-util", "rt", "rt-multi-thread", "macros"], optional = true }
35+
tokio = { version = "1.0", features = ["rt", "rt-multi-thread"], optional = true }
3636
tokio-rustls = { version = "0.24", optional = true }
3737

3838
[dev-dependencies]

bitreq/examples/async_hello.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
//! This example demonstrates the `async` feature.
22
3-
#[tokio::main]
4-
async fn main() -> Result<(), bitreq::Error> {
5-
let response = bitreq::get("http://httpbin.org/get").send_async().await?;
3+
fn main() -> Result<(), bitreq::Error> {
4+
let runtime = tokio::runtime::Builder::new_current_thread()
5+
.build()
6+
.expect("failed to build Tokio runtime");
67

7-
println!("Status: {}", response.status_code);
8-
println!("Body: {}", response.as_str()?);
8+
runtime.block_on(async {
9+
let response = bitreq::get("http://httpbin.org/get").send_async().await?;
910

10-
Ok(())
11+
println!("Status: {}", response.status_code);
12+
println!("Body: {}", response.as_str()?);
13+
14+
Ok(())
15+
})
1116
}

0 commit comments

Comments
 (0)