From 3cd5ab1822d5fa955b7c15863d620429356dde2f Mon Sep 17 00:00:00 2001 From: Garrett Squire Date: Wed, 17 May 2017 23:11:29 -0700 Subject: [PATCH] update some of the wording to be clearer --- src/net.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/net.md b/src/net.md index 8704edb..ac86175 100644 --- a/src/net.md +++ b/src/net.md @@ -414,8 +414,9 @@ quick_main!(run); [![reqwest-badge]][reqwest] [![cat-net-badge]][cat-net] Query the [GitHub Users Endpoint](https://api.github.com/users) using a HEAD request and then inspect the -response code to determine success. The [`reqwest::Client`] offers a timeout option which accepts a [`Duration`] as an argument. This is a quick way to query a rest resource without -needing to receive a body. +response code to determine success. This is a quick way to query a rest resource without +needing to receive a body. You can also configure the [`reqwest::Client`] to use a timeout +which ensures that a request will not last longer than what it is configured with. ```rust,no_run #[macro_use] @@ -437,7 +438,7 @@ fn run() -> Result<()> { let request_url = "https://api.github.com/users/ferris-the-crab"; println!("{}", request_url); - // Make a timeout for our request. + // The timeout for the request is set to 5 seconds. let timeout = Duration::new(5, 0); let mut client = Client::new()?;