Skip to content

Commit 99f2924

Browse files
authored
chore(response): change methods to consume self instead of borrowing
1 parent 3288644 commit 99f2924

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/client/resp/http.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ impl Response {
9696
///
9797
/// This creates a new HTTP response with the same version, status, headers, and extensions
9898
/// as the current response, but with the provided body.
99-
fn build_response(&self, body: wreq::Body) -> wreq::Response {
99+
fn build_response(self, body: wreq::Body) -> wreq::Response {
100100
let mut response = HttpResponse::new(body);
101101
*response.version_mut() = self.version.into_ffi();
102102
*response.status_mut() = self.status.0;
103-
*response.headers_mut() = self.headers.0.clone();
104-
*response.extensions_mut() = self.extensions.clone();
103+
*response.headers_mut() = self.headers.0;
104+
*response.extensions_mut() = self.extensions;
105105
wreq::Response::from(response)
106106
}
107107

@@ -151,7 +151,7 @@ impl Response {
151151
/// Creates an empty response with the same metadata but no body content.
152152
///
153153
/// Useful for operations that only need response headers/metadata without consuming the body.
154-
fn empty_response(&self) -> wreq::Response {
154+
fn empty_response(self) -> wreq::Response {
155155
self.build_response(wreq::Body::from(Bytes::new()))
156156
}
157157
}

0 commit comments

Comments
 (0)