-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set default request timeout of 60 seconds, configurable #382
Conversation
/// ```rust | ||
/// use goose::util; | ||
/// | ||
/// // No decimal returns a proper float. | ||
/// assert_eq!(util::get_float_from_string(Some("1".to_string())), Some(1.0)); | ||
/// | ||
/// // Leading decimal returns a proper float. | ||
/// assert_eq!(util::get_float_from_string(Some(".1".to_string())), Some(0.1)); | ||
/// | ||
/// // Valid float string returns a proper float. | ||
/// assert_eq!(util::get_float_from_string(Some("1.1".to_string())), Some(1.1)); | ||
/// | ||
/// // Invalid number with too many decimals returns None. | ||
/// assert_eq!(util::get_float_from_string(Some("1.1.1".to_string())), None); | ||
/// | ||
/// // No number returns None. | ||
/// assert_eq!(util::get_float_from_string(None), None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love doc tests!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to my (n00b) me.
798dcf6
to
36fcb65
Compare
36fcb65
to
366bc9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RTBM
--timeout VALUE
where VALUE is seconds as integer or a float; timeout can be configured programatically usingGooseDefault::Timeout
utils::get_float_from_string()
, now used byutils::get_hatch_rate()
set_client_builder()
documentation to reflect how this changes the default Reqwest Client configuration