Replaced unwrap with unwrap_or_default

This commit is contained in:
Vamist 2021-02-01 23:45:29 +00:00
parent 8d77740588
commit 29949af2cb
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ use std::{fs, path::PathBuf};
/// Parses an ID
fn parse_id(id: &str) -> Result<i32, HttpResponse> {
// 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),