use std::path::{Path, PathBuf};
use rocket::response::NamedFile;

#[get("/<path..>", rank = 5)]
fn all(path: PathBuf) -> Option<NamedFile> {
    NamedFile::open(Path::new("static/").join(path)).ok()
}

use rocket::response::NamedFile;
use std::io;
use std::path::{Path, PathBuf};

#[get("/<path..>", rank = 5)]
fn all(path: PathBuf) -> io::Result<NamedFile> {
    NamedFile::open(Path::new("static/").join(path))
}

--- 
+++ 
@@ -1,7 +1,8 @@
+use rocket::response::NamedFile;
+use std::io;
 use std::path::{Path, PathBuf};
-use rocket::response::NamedFile;
 
 #[get("/<path..>", rank = 5)]
-fn all(path: PathBuf) -> Option<NamedFile> {
-    NamedFile::open(Path::new("static/").join(path)).ok()
+fn all(path: PathBuf) -> io::Result<NamedFile> {
+    NamedFile::open(Path::new("static/").join(path))
 }
Return 404 on missing static file in todo example.
