diff --git a/src/proxy.rs b/src/proxy.rs index a9fcf3e..fce6510 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -94,11 +94,7 @@ impl Handler for ProxyServer // We first extract all URL segments starting from the mountpoint let segments: PathBuf = req.segments(0..).unwrap(); - let query_part = if let Some(query) = req.uri().query() { - format!("?{}", query) - }else{ - String::from("") - }; + let query_part = req.uri().query().map_or(String::from(""), |s| format!("?{}", s)); let url = format!( "{}{}/{}{}",