Skip to content

Commit

Permalink
Remove unescessary comment and normalize method name
Browse files Browse the repository at this point in the history
  • Loading branch information
mikayla-maki committed Oct 1, 2024
1 parent 8945f4a commit fd110f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/async_impl/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ impl ClientBuilder {
/// Set a `RedirectPolicy` for this client.
///
/// Default will follow redirects up to a maximum of 10.
pub fn redirect(mut self, policy: redirect::Policy) -> ClientBuilder {
pub fn redirect_policy(mut self, policy: redirect::Policy) -> ClientBuilder {
self.config.redirect_policy = policy;
self
}
Expand Down
2 changes: 1 addition & 1 deletion src/async_impl/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl RequestBuilder {
}

/// Overrides the client's redirect policy for this request
pub fn redirect(mut self, policy: redirect::Policy) -> RequestBuilder {
pub fn redirect_policy(mut self, policy: redirect::Policy) -> RequestBuilder {
if let Ok(ref mut req) = self.request {
*req.redirect_policy_mut() = Some(policy)
}
Expand Down
5 changes: 2 additions & 3 deletions tests/redirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async fn test_redirect_policy_can_stop_redirects_without_an_error() {
let url = format!("http://{}/no-redirect", server.addr());

let res = reqwest::Client::builder()
.redirect(reqwest::redirect::Policy::none())
.redirect_policy(reqwest::redirect::Policy::none())
.build()
.unwrap()
.get(&url)
Expand Down Expand Up @@ -377,7 +377,6 @@ async fn test_redirect_https_only_enforced_gh1312() {
assert!(err.is_redirect());
}

// Code taken from: https://github.com/seanmonstar/reqwest/pull/1204
#[tokio::test]
async fn test_request_redirect() {
let code = 301u16;
Expand Down Expand Up @@ -420,7 +419,7 @@ async fn test_request_redirect() {
);

let no_redirect_client = reqwest::Client::builder()
.redirect(reqwest::redirect::Policy::none())
.redirect_policy(reqwest::redirect::Policy::none())
.build()
.unwrap();

Expand Down

0 comments on commit fd110f6

Please sign in to comment.