mirror of https://github.com/raftario/filite.git
Replaced unwrap with unwrap_or_default
This commit is contained in:
parent
8d77740588
commit
29949af2cb
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue