Use std::time::Duration
This commit is contained in:
parent
8732fee6c5
commit
81eb39a536
|
@ -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
|
||||
|
|
|
@ -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…
Reference in New Issue