Skip to content

Commit

Permalink
fix: crate build issues with stream feature
Browse files Browse the repository at this point in the history
Fix a build issue introduced by XAMPPRocky#690 when building octocrab with the
`stream` feature.

Closes: XAMPPRocky#707
  • Loading branch information
benpueschel committed Oct 6, 2024
1 parent 9fbf59c commit a70de15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/api/repos/release_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ impl<'octo, 'r> ReleaseAssetsHandler<'octo, 'r> {

let route = format!(
"/{}/releases/assets/{id}",
owner = self.parent.owner,
repo = self.parent.repo,
self.handler.repo,
id = id,
);

Expand All @@ -107,9 +106,9 @@ impl<'octo, 'r> ReleaseAssetsHandler<'octo, 'r> {
.method(http::Method::GET)
.uri(uri)
.header(http::header::ACCEPT, "application/octet-stream");
let request = self.parent.crab.build_request(builder, None::<&()>)?;
let response = self.parent.crab.execute(request).await?;
let response = self.parent.crab.follow_location_to_data(response).await?;
let request = self.handler.crab.build_request(builder, None::<&()>)?;
let response = self.handler.crab.execute(request).await?;
let response = self.handler.crab.follow_location_to_data(response).await?;
Ok(http_body_util::BodyStream::new(response.into_body())
.try_filter_map(|frame| futures_util::future::ok(frame.into_data().ok())))
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/repos/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl<'octo, 'r> ReleasesHandler<'octo, 'r> {
&self,
asset_id: u64,
) -> crate::Result<impl futures_core::Stream<Item = crate::Result<bytes::Bytes>>> {
self.parent.release_assets().stream(asset_id).await
self.handler.release_assets().stream(asset_id).await
}

/// Delete a release using its id.
Expand Down

0 comments on commit a70de15

Please sign in to comment.