use std::{fs, io, path}; pub fn open_file(path: &path::Path) -> io::Result> { match fs::File::open(path) { Ok(file) => Ok(Some(file)), Err(err) => match err.kind() { io::ErrorKind::NotFound => Ok(None), _ => Err(err), }, } }