diff --git a/Cargo.toml b/Cargo.toml index 26dc2c0..a3825f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "libreddit" description = " Alternative private front-end to Reddit" license = "AGPL-3.0" repository = "https://github.com/spikecodes/libreddit" -version = "0.5.0" +version = "0.5.1" authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"] edition = "2018" diff --git a/src/main.rs b/src/main.rs index 80f6071..13b629a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -217,9 +217,9 @@ async fn main() { app.at("/:id").get(|req: Request| { async { - match req.param("id") { + match req.param("id").as_deref() { // Sort front page - // Some("best") | Some("hot") | Some("new") | Some("top") | Some("rising") | Some("controversial") => subreddit::community(req).await, + Some("best") | Some("hot") | Some("new") | Some("top") | Some("rising") | Some("controversial") => subreddit::community(req).await, // Short link for post Some(id) if id.len() > 4 && id.len() < 7 => post::item(req).await, // Error message for unknown pages