File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -46,21 +46,23 @@ pub struct HttpConnector<R = GaiResolver> {
46
46
/// # Example
47
47
///
48
48
/// ```
49
+ /// # #![feature(async_await)]
50
+ /// # async fn doc() -> hyper::Result<()> {
49
51
/// use hyper::Uri;
50
52
/// use hyper::client::{Client, connect::HttpInfo};
51
- /// use hyper::rt::Future;
52
53
///
53
54
/// let client = Client::new();
55
+ /// let uri = Uri::from_static("http://example.com");
54
56
///
55
- /// let fut = client.get(Uri::from_static("http://example.local"))
56
- /// .inspect(|resp| {
57
- /// resp
58
- /// .extensions()
59
- /// .get::<HttpInfo>()
60
- /// .map(|info| {
61
- /// println!("remote addr = {}", info.remote_addr());
62
- /// });
57
+ /// let res = client.get(uri).await?;
58
+ /// res
59
+ /// .extensions()
60
+ /// .get::<HttpInfo>()
61
+ /// .map(|info| {
62
+ /// println!("remote addr = {}", info.remote_addr());
63
63
/// });
64
+ /// # Ok(())
65
+ /// # }
64
66
/// ```
65
67
///
66
68
/// # Note
You can’t perform that action at this time.
0 commit comments