diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-08-26 00:48:25 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2020-08-26 01:13:20 +0200 |
commit | aead9dc91eaa51922c8f93daa38d5d18d73e3890 (patch) | |
tree | 01df8f95e41586ce816d0c08b17c6c53d75425a1 /cli/http_util.rs | |
parent | 9bfb0df805719cb3f022a5b5d9f9d898ae954c2e (diff) |
Remove some more unnecessary 'to_string()' calls (#7190)
Diffstat (limited to 'cli/http_util.rs')
-rw-r--r-- | cli/http_util.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cli/http_util.rs b/cli/http_util.rs index bf302f7b2..72aaee682 100644 --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -44,12 +44,9 @@ pub fn create_http_client(ca_file: Option<&str>) -> Result<Client, ErrBox> { builder = builder.add_root_certificate(cert); } - builder.build().map_err(|_| { - ErrBox::from(io::Error::new( - io::ErrorKind::Other, - "Unable to build http client".to_string(), - )) - }) + builder + .build() + .map_err(|_| ErrBox::error("Unable to build http client")) } /// Construct the next uri based on base uri and location header fragment /// See <https://tools.ietf.org/html/rfc3986#section-4.2> |