Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In [#1634][1], it was assumed that you cannot use the builder anymore after `await`ing it, which is why `.unwrap()` was used for `get_cache_settings`. However this isn't entirely correct because mutable references implement `Future` too, so this example would compile but panic at runtime: ```rust let mut builder = Client::builder("a"); let client = (&mut builder).await.unwrap(); let settings = builder.get_cache_settings(); ``` Instead of unwrapping, a note was added to the docs to reflect this. While this change isn't necessary for `http`, it avoids creating a new `Http` instance by using `std::mem::take()` that's most likely never even accessed anyway. [1]: #1634
- Loading branch information
Showing
1 changed file
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters