Skip to content

Commit 54c4d3c

Browse files
[octocrab] Expose get_links from page module
The commit compare endpoint does not conform to how octocrab expects paginated response bodies to be shaped. So, we need to expose a way to get the pagination headers from the response and manually do a little pagination ourselves.
1 parent 17056cd commit 54c4d3c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ mod api;
185185
mod body;
186186
mod error;
187187
mod from_response;
188-
mod page;
188+
pub mod page;
189189

190190
pub mod auth;
191191
pub mod etag;

src/page.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ impl<T: serde::de::DeserializeOwned> crate::FromResponse for Page<T> {
226226
}
227227
}
228228

229-
struct HeaderLinks {
229+
pub struct HeaderLinks {
230230
next: Option<Uri>,
231231
prev: Option<Uri>,
232232
first: Option<Uri>,
233233
last: Option<Uri>,
234234
}
235235

236-
fn get_links(headers: &http::header::HeaderMap) -> crate::Result<HeaderLinks> {
236+
pub fn get_links(headers: &http::header::HeaderMap) -> crate::Result<HeaderLinks> {
237237
let mut first = None;
238238
let mut prev = None;
239239
let mut next = None;

0 commit comments

Comments
 (0)