Skip to content

Commit a6b9a46

Browse files
committed
rust: update octocrab to latest
Let's stay modern.
1 parent 53feed6 commit a6b9a46

File tree

3 files changed

+160
-33
lines changed

3 files changed

+160
-33
lines changed

Cargo.lock

Lines changed: 150 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ flate2 = "1.0.26"
1414
futures = "0.3.28"
1515
goblin = "0.6.1"
1616
hex = "0.4.3"
17+
hyper = "0.14.26"
1718
object = "0.31.0"
18-
octocrab = { version = "0.19.0", features = ["rustls"] }
19+
octocrab = { version = "0.21.0" }
1920
once_cell = "1.17.1"
2021
rayon = "1.7.0"
2122
reqwest = {version = "0.11.17", features = ["rustls"] }

src/github.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ use {
2424

2525
async fn fetch_artifact(client: &Octocrab, artifact: WorkflowListArtifact) -> Result<bytes::Bytes> {
2626
println!("downloading {}", artifact.name);
27-
let res = client
28-
.execute(client.request_builder(artifact.archive_download_url, reqwest::Method::GET))
29-
.await?;
27+
let res = client._get(artifact.archive_download_url.as_str()).await?;
3028

31-
Ok(res.bytes().await?)
29+
Ok(hyper::body::to_bytes(res.into_body()).await?)
3230
}
3331

3432
async fn upload_release_artifact(
@@ -54,11 +52,13 @@ async fn upload_release_artifact(
5452

5553
println!("uploading to {}", url);
5654

57-
let request = client
58-
.request_builder(url, reqwest::Method::POST)
55+
let request = hyper::http::request::Builder::new()
56+
.method(reqwest::Method::POST)
57+
.uri(url.as_str())
5958
.header("Content-Length", data.len())
60-
.header("Content-Type", "application/x-tar")
61-
.body(data);
59+
.header("Content-Type", "application/x-tar");
60+
61+
let request = client.build_request(request, Some(&data))?;
6262

6363
if dry_run {
6464
return Ok(());

0 commit comments

Comments
 (0)