summaryrefslogtreecommitdiffstats
path: root/github_v3/src/lib.rs
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2020-03-01 15:54:23 +0000
committerKornel <kornel@geekhood.net>2020-03-01 22:14:40 +0000
commit01ad124c4872ed24751d5c36a8444bddbc4a4a64 (patch)
tree66c44047fb79f03b3ac45a7ccf5fabf0667d61e5 /github_v3/src/lib.rs
parenta38758e88c390600fef6a2eda243296bf8a198f6 (diff)
fmt
Diffstat (limited to 'github_v3/src/lib.rs')
-rw-r--r--github_v3/src/lib.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/github_v3/src/lib.rs b/github_v3/src/lib.rs
index 36e498a..e1cb472 100644
--- a/github_v3/src/lib.rs
+++ b/github_v3/src/lib.rs
@@ -1,19 +1,19 @@
-use std::sync::atomic::Ordering::SeqCst;
-use std::sync::atomic::AtomicU32;
-use std::sync::Arc;
-pub use reqwest::StatusCode;
+use futures::Stream;
+pub use futures::StreamExt;
pub use reqwest::header::HeaderMap;
pub use reqwest::header::HeaderValue;
-pub use futures::StreamExt;
-use futures::Stream;
+pub use reqwest::StatusCode;
use serde::de::DeserializeOwned;
+use std::sync::atomic::AtomicU32;
+use std::sync::atomic::Ordering::SeqCst;
+use std::sync::Arc;
use std::time::{Duration, SystemTime};
pub mod model;
pub struct Response {
res: reqwest::Response,
- client: Arc<ClientInner>
+ client: Arc<ClientInner>,
}
impl Response {
@@ -21,7 +21,7 @@ impl Response {
Ok(self.res.json().await?)
}
- pub fn array<T: DeserializeOwned + std::marker::Unpin + 'static>(self) -> impl Stream<Item=Result<T, GHError>> {
+ pub fn array<T: DeserializeOwned + std::marker::Unpin + 'static>(self) -> impl Stream<Item = Result<T, GHError>> {
let mut res = self.res;
let client = self.client;
@@ -204,7 +204,7 @@ fn parse_next_link(link: &str) -> Option<String> {
for part in link.split(',') {
if part.contains(r#"; rel="next""#) {
if let Some(start) = link.find('<') {
- let link = &link[start+1..];
+ let link = &link[start + 1..];
if let Some(end) = link.find('>') {
return Some(link[..end].to_owned());
}