Fix unwrap

This commit is contained in:
Dessalines 2021-07-05 20:01:31 -04:00
parent 97a944100b
commit 2082442fdc

View File

@ -130,8 +130,8 @@ async fn get_feed(
) -> Result<HttpResponse, Error> {
let sort_type = get_sort_type(info).map_err(ErrorBadRequest)?;
let req_type: String = req.match_info().get("type").unwrap().parse().unwrap();
let param: String = req.match_info().get("name").unwrap().parse().unwrap();
let req_type: String = req.match_info().get("type").unwrap_or("none").parse()?;
let param: String = req.match_info().get("name").unwrap_or("none").parse()?;
let request_type = match req_type.as_str() {
"u" => RequestType::User,