diff --git a/examples/todo/src/static_files.rs b/examples/todo/src/static_files.rs index 61ed862a..0336de7a 100644 --- a/examples/todo/src/static_files.rs +++ b/examples/todo/src/static_files.rs @@ -1,8 +1,7 @@ -use rocket::response::NamedFile; -use std::io; use std::path::{Path, PathBuf}; +use rocket::response::NamedFile; #[get("/", rank = 5)] -fn all(path: PathBuf) -> io::Result { - NamedFile::open(Path::new("static/").join(path)) +fn all(path: PathBuf) -> Option { + NamedFile::open(Path::new("static/").join(path)).ok() }