reqwest_client: Remove example (#37410)
This PR removes the example from the `reqwest_client` crate, as it doesn't seem worth maintaining. Release Notes: - N/A
This commit is contained in:
Generated
-1
@@ -13748,7 +13748,6 @@ dependencies = [
|
||||
"regex",
|
||||
"reqwest 0.12.15 (git+https://github.com/zed-industries/reqwest.git?rev=951c770a32f1998d6e999cef3e59e0013e6c4415)",
|
||||
"serde",
|
||||
"smol",
|
||||
"tokio",
|
||||
"workspace-hack",
|
||||
]
|
||||
|
||||
@@ -15,10 +15,6 @@ test-support = []
|
||||
path = "src/reqwest_client.rs"
|
||||
doctest = true
|
||||
|
||||
[[example]]
|
||||
name = "client"
|
||||
path = "examples/client.rs"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
bytes.workspace = true
|
||||
@@ -26,7 +22,6 @@ futures.workspace = true
|
||||
http_client.workspace = true
|
||||
http_client_tls.workspace = true
|
||||
serde.workspace = true
|
||||
smol.workspace = true
|
||||
log.workspace = true
|
||||
tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
|
||||
regex.workspace = true
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
use std::time::Instant;
|
||||
|
||||
use futures::AsyncReadExt as _;
|
||||
use futures::stream::FuturesUnordered;
|
||||
use http_client::AsyncBody;
|
||||
use http_client::HttpClient;
|
||||
use reqwest_client::ReqwestClient;
|
||||
use smol::stream::StreamExt;
|
||||
|
||||
fn main() {
|
||||
let app = gpui::Application::new();
|
||||
app.run(|cx| {
|
||||
cx.spawn(async move |cx| {
|
||||
let client = ReqwestClient::new();
|
||||
let start = Instant::now();
|
||||
let requests = [
|
||||
client.get("https://www.google.com/", AsyncBody::empty(), true),
|
||||
client.get("https://zed.dev/", AsyncBody::empty(), true),
|
||||
client.get("https://docs.rs/", AsyncBody::empty(), true),
|
||||
];
|
||||
let mut requests = requests.into_iter().collect::<FuturesUnordered<_>>();
|
||||
while let Some(response) = requests.next().await {
|
||||
let mut body = String::new();
|
||||
response
|
||||
.unwrap()
|
||||
.into_body()
|
||||
.read_to_string(&mut body)
|
||||
.await
|
||||
.unwrap();
|
||||
println!("{}", &body.len());
|
||||
}
|
||||
println!("{:?}", start.elapsed());
|
||||
|
||||
cx.update(|cx| {
|
||||
cx.quit();
|
||||
})
|
||||
.ok();
|
||||
})
|
||||
.detach();
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user