Rename option to “pool_max_idle_per_host” (#917)

reqwest exposes the “pool_max_idle_per_host” option of hyper’s client
builder. This option used to be called “max_idle_per_host” in the hyper
crate, but it has recently been renamed [1].

This patch renames the reqwest representation of this option to make it
consistent with its name in the hyper crate again.

[1] https://github.com/hyperium/hyper/pull/2142
This commit is contained in:
Patrick Lühne
2020-05-22 17:05:44 +02:00
committed by GitHub
parent b5706f2d89
commit ecf1df572c
2 changed files with 18 additions and 6 deletions

View File

@@ -309,8 +309,14 @@ impl ClientBuilder {
}
/// Sets the maximum idle connection per host allowed in the pool.
pub fn pool_max_idle_per_host(self, max: usize) -> ClientBuilder {
self.with_inner(move |inner| inner.pool_max_idle_per_host(max))
}
#[doc(hidden)]
#[deprecated(note = "use pool_max_idle_per_host instead")]
pub fn max_idle_per_host(self, max: usize) -> ClientBuilder {
self.with_inner(move |inner| inner.max_idle_per_host(max))
self.pool_max_idle_per_host(max)
}
/// Enable case sensitive headers.