From d5b1c3a5bb0da63dba6fb843449307e3ad52cbe6 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Tue, 26 Jan 2021 11:00:07 -0800 Subject: [PATCH] Fix connection reset error --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index 865c97c..52a5637 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -459,7 +459,7 @@ pub async fn request(path: String) -> Result { // If response is success Ok(response) => { // Parse the response from Reddit as JSON - match from_str(&response.into_string().unwrap()) { + match from_str(&response.into_string().unwrap_or_default()) { Ok(json) => Ok(json), Err(_) => { dbg!(format!("{} - Failed to parse page JSON data", url));