From a3369ce8903dde21d898ad773c2aeeaf42059aa8 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 6 Nov 2024 21:10:27 +0000 Subject: [PATCH] refactor(net): rename OnRequest::response as respond --- src/net/system.rs | 2 +- tests/net.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net/system.rs b/src/net/system.rs index 58e22a8..7396c89 100644 --- a/src/net/system.rs +++ b/src/net/system.rs @@ -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) } } diff --git a/tests/net.rs b/tests/net.rs index 14374d6..426b919 100644 --- a/tests/net.rs +++ b/tests/net.rs @@ -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