Skip to content

Commit 2c07bb5

Browse files
committed
src: Fix clippy from_over_into warnings
Nightly clippy strikes again. `Request` and `Response` ignore this, because it makes the docs worse. See rust-lang/rust-clippy#6607 Switched `RequestBuilder` -> `Request` to use `From`.
1 parent 8f00394 commit 2c07bb5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/request.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ impl From<http::Request> for Request {
382382
}
383383
}
384384

385+
#[allow(clippy::from_over_into)]
385386
impl Into<http::Request> for Request {
386387
/// Converts a `surf::Request` to an `http::Request`.
387388
fn into(self) -> http::Request {

src/request_builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,9 @@ impl Future for RequestBuilder {
288288
}
289289
}
290290

291-
impl Into<Request> for RequestBuilder {
291+
impl From<RequestBuilder> for Request {
292292
/// Converts a `surf::RequestBuilder` to a `surf::Request`.
293-
fn into(self) -> Request {
294-
self.build()
293+
fn from(builder: RequestBuilder) -> Request {
294+
builder.build()
295295
}
296296
}

src/response.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ impl From<http::Response> for Response {
321321
}
322322
}
323323

324+
#[allow(clippy::from_over_into)]
324325
impl Into<http::Response> for Response {
325326
fn into(self) -> http::Response {
326327
self.res

0 commit comments

Comments
 (0)