Browse Source

Use std::time::Duration

master
blank X 7 months ago
parent
commit
81eb39a536
Signed by: blankie GPG Key ID: CC15FC822C7F61F5
  1. 3
      src/github/mod.rs
  2. 6
      src/gitlab/mod.rs

3
src/github/mod.rs

@ -10,6 +10,7 @@ use reqwest::{
use std::env;
use std::io::Cursor;
use std::iter::Skip;
use std::time::Duration;
extern crate serde_json;
pub async fn run(mut args: Skip<env::Args>) {
@ -27,7 +28,7 @@ pub async fn run(mut args: Skip<env::Args>) {
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION")
))
.timeout(60)
.timeout(Duration::from_secs(60))
.build()
.unwrap();
let text = client

6
src/gitlab/mod.rs

@ -7,6 +7,7 @@ use std::borrow::Cow;
use std::env;
use std::io::Cursor;
use std::iter::Skip;
use std::time::Duration;
extern crate serde_json;
pub async fn run(mut args: Skip<env::Args>) {
@ -17,7 +18,10 @@ pub async fn run(mut args: Skip<env::Args>) {
"mr" => structs::MR_QUERY,
_ => panic!("Unknown type"),
};
let client = ClientBuilder::new().timeout(60).build().unwrap();
let client = ClientBuilder::new()
.timeout(Duration::from_secs(60))
.build()
.unwrap();
let text = client
.post("https://gitlab.com/api/graphql")
.body(

Loading…
Cancel
Save