From 29949af2cb0fc4d6b7ced1b5bb7e7aea01de6fa4 Mon Sep 17 00:00:00 2001 From: Vamist Date: Mon, 1 Feb 2021 23:45:29 +0000 Subject: [PATCH] Replaced unwrap with unwrap_or_default --- src/routes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes.rs b/src/routes.rs index 5847a25..265dd9d 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -19,7 +19,7 @@ use std::{fs, path::PathBuf}; /// Parses an ID fn parse_id(id: &str) -> Result { // Remove any file extension from id - let id = id.split('.').next().unwrap(); + let id = id.split('.').next().unwrap_or_default(); match i32::from_str_radix(id, 36) { Ok(id) => Ok(id),