1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-23 16:21:06 +01:00

awc: Rename Client::build to Client::builder (#1665)

This commit is contained in:
Igor Aleksanov 2020-09-11 11:24:39 +03:00 committed by GitHub
parent 22089aff87
commit 121075c1ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 19 additions and 16 deletions

View File

@ -1,6 +1,8 @@
# Changes
## Unreleased - 2020-xx-xx
### Changed
* `Client::build` was renamed to `Client::builder`.
## 2.0.0-beta.4 - 2020-09-09

View File

@ -166,8 +166,9 @@ impl Client {
Client::default()
}
/// Build client instance.
pub fn build() -> ClientBuilder {
/// Create `Client` builder.
/// This function is equivalent of `ClientBuilder::new()`.
pub fn builder() -> ClientBuilder {
ClientBuilder::new()
}

View File

@ -623,7 +623,7 @@ mod tests {
#[actix_rt::test]
async fn test_client_header() {
let req = Client::build()
let req = Client::builder()
.header(header::CONTENT_TYPE, "111")
.finish()
.get("/");
@ -641,7 +641,7 @@ mod tests {
#[actix_rt::test]
async fn test_client_header_override() {
let req = Client::build()
let req = Client::builder()
.header(header::CONTENT_TYPE, "111")
.finish()
.get("/")

View File

@ -434,7 +434,7 @@ mod tests {
#[actix_rt::test]
async fn test_header_override() {
let req = Client::build()
let req = Client::builder()
.header(header::CONTENT_TYPE, "111")
.finish()
.ws("/")

View File

@ -120,7 +120,7 @@ async fn test_timeout() {
.timeout(Duration::from_secs(15))
.finish();
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(connector)
.timeout(Duration::from_millis(50))
.finish();
@ -141,7 +141,7 @@ async fn test_timeout_override() {
})))
});
let client = awc::Client::build()
let client = awc::Client::builder()
.timeout(Duration::from_millis(50000))
.finish();
let request = client
@ -291,7 +291,7 @@ async fn test_connection_wait_queue() {
})
.await;
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(awc::Connector::new().limit(1).finish())
.finish();
@ -340,7 +340,7 @@ async fn test_connection_wait_queue_force_close() {
})
.await;
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(awc::Connector::new().limit(1).finish())
.finish();

View File

@ -47,7 +47,7 @@ async fn test_connection_window_size() {
.set_alpn_protos(b"\x02h2\x08http/1.1")
.map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(awc::Connector::new().ssl(builder.build()).finish())
.initial_window_size(100)
.initial_connection_window_size(100)

View File

@ -82,7 +82,7 @@ async fn _test_connection_reuse_h2() {
.dangerous()
.set_certificate_verifier(Arc::new(danger::NoCertificateVerification {}));
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(awc::Connector::new().rustls(Arc::new(config)).finish())
.finish();

View File

@ -62,7 +62,7 @@ async fn test_connection_reuse_h2() {
.set_alpn_protos(b"\x02h2\x08http/1.1")
.map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(awc::Connector::new().ssl(builder.build()).finish())
.finish();

View File

@ -822,7 +822,7 @@ where
}
};
Client::build().connector(connector).finish()
Client::builder().connector(connector).finish()
};
TestServer {

View File

@ -90,7 +90,7 @@ pub async fn test_server<F: ServiceFactory<TcpStream>>(factory: F) -> TestServer
}
};
Client::build().connector(connector).finish()
Client::builder().connector(connector).finish()
};
actix_connect::start_default_resolver().await.unwrap();

View File

@ -43,7 +43,7 @@ async fn test_start() {
{
use actix_http::client;
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(
client::Connector::new()
.timeout(Duration::from_millis(100))
@ -115,7 +115,7 @@ async fn test_start_ssl() {
.set_alpn_protos(b"\x02h2\x08http/1.1")
.map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
let client = awc::Client::build()
let client = awc::Client::builder()
.connector(
awc::Connector::new()
.ssl(builder.build())