From 467342edf449f1fc23b5c29aa480112d44d74ed2 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Thu, 18 Mar 2021 08:51:31 -0700 Subject: [PATCH] Patch broken homepage sorting --- Cargo.toml | 2 +- src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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