]> git.proxmox.com Git - proxmox.git/commitdiff
clippy fix: unnecessary use of `to_string`
authorLukas Wagner <l.wagner@proxmox.com>
Tue, 8 Aug 2023 08:01:47 +0000 (10:01 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 8 Aug 2023 09:29:36 +0000 (11:29 +0200)
See:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
proxmox-openid/src/http_client.rs

index e391421a86f9fda4808651ce7df2fc65c81cd5c3..1850d64e76d799bcdb42234b5f83f66e32703ebd 100644 (file)
@@ -54,15 +54,15 @@ fn ureq_agent() -> Result<ureq::Agent, Error> {
 pub fn http_client(request: HttpRequest) -> Result<HttpResponse, Error> {
     let agent = ureq_agent()?;
     let mut req = if let Method::POST = request.method {
-        agent.post(&request.url.to_string())
+        agent.post(request.url.as_ref())
     } else {
-        agent.get(&request.url.to_string())
+        agent.get(request.url.as_ref())
     };
 
     for (name, value) in request.headers {
         if let Some(name) = name {
             req = req.set(
-                &name.to_string(),
+                name.as_ref(),
                 value.to_str().map_err(|_| {
                     Error::Other(format!(
                         "invalid {} header value {:?}",