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,
}
impl<'net> OnRequest<'net> {
pub fn response(self, response: reqwest::Response) {
pub fn respond(self, response: reqwest::Response) {
self.net._on(self.request, response)
}
}

View file

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