diff --git a/src/servek/html.rs b/src/servek/html.rs index f923dc2..55b4c0d 100644 --- a/src/servek/html.rs +++ b/src/servek/html.rs @@ -30,18 +30,17 @@ impl Server { warp::path!("@" / String) .and(Self::with_server(self.clone())) .and_then(|username: String, srv: Server| async move { - match srv - .hb + srv.hb .render( "profile", - &serde_json::json!(srv.profiler.profile(username).await?), + &serde_json::json!(srv + .profiler + .profile(username) + .await + .map_err(|e| ServerError::from(e))?), ) .map(|html| warp::reply::html(html)) .map_err(|e| ServerError::from(e).reject_self()) - { - Ok(resp) => Ok(resp), - Err(err) => Err(err), - } }), ) }