> Err(ref error) if error.kind() == ErrorKind::NotFound => {
ここが
Err(ref error.kind() == ErrorKind::NotFound) => {

こうなっていない時点でrustは汚い