[pbs-devel] [PATCH proxmox 5/6] rest: do not convert string to string

Maximiliano Sandoval m.sandoval at proxmox.com
Wed Feb 28 12:39:19 CET 2024


Fixes the clippy warning:

    warning: useless conversion to the same type: `std::string::String`
       --> proxmox-rest-server/src/rest.rs:158:41
        |
    158 |                     .header("Location", String::from(location_value))
        |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `location_value`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
        = note: `#[warn(clippy::useless_conversion)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 proxmox-rest-server/src/rest.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs
index 4900592d..39ae9a18 100644
--- a/proxmox-rest-server/src/rest.rs
+++ b/proxmox-rest-server/src/rest.rs
@@ -155,7 +155,7 @@ impl Service<Request<Body>> for RedirectService {
 
                 Response::builder()
                     .status(status_code)
-                    .header("Location", String::from(location_value))
+                    .header("Location", location_value)
                     .body(Body::empty())?
             } else {
                 Response::builder()
-- 
2.39.2





More information about the pbs-devel mailing list