refactor(net): rename OnRequest::response as respond

This commit is contained in:
Paul Campbell 2024-11-06 21:10:27 +00:00
parent 3b2610d6c9
commit a3369ce890
2 changed files with 4 additions and 4 deletions

View file

@ -88,7 +88,7 @@ pub struct OnRequest<'net> {
request: reqwest::Request, request: reqwest::Request,
} }
impl<'net> OnRequest<'net> { impl<'net> OnRequest<'net> {
pub fn response(self, response: reqwest::Response) { pub fn respond(self, response: reqwest::Response) {
self.net._on(self.request, response) self.net._on(self.request, response)
} }
} }

View file

@ -17,7 +17,7 @@ async fn test_get() -> TestResult {
.body("Get OK") .body("Get OK")
.expect("request body"); .expect("request body");
net.on(request).response(my_response.into()); net.on(request).respond(my_response.into());
//when //when
let response = net.send(client.get(url)).await?; let response = net.send(client.get(url)).await?;
@ -43,7 +43,7 @@ async fn test_post() -> TestResult {
.body("Post OK") .body("Post OK")
.expect("request body"); .expect("request body");
net.on(request).response(my_response.into()); net.on(request).respond(my_response.into());
//when //when
let response = net.send(client.post(url)).await?; let response = net.send(client.post(url)).await?;
@ -70,7 +70,7 @@ async fn test_unused_post() {
.body("Post OK") .body("Post OK")
.expect("request body"); .expect("request body");
net.on(request).response(my_response.into()); net.on(request).respond(my_response.into());
//when //when
// don't send the planned request // don't send the planned request