(fname: &str)
| 5 | pub static MNIST_PATH: &'static str = ".rustml/datasets/mnist_digits"; |
| 6 | |
| 7 | pub fn path_for(fname: &str) -> Result<String, &'static str> { |
| 8 | |
| 9 | match home_dir() { |
| 10 | Some(ref mut p) => { |
| 11 | p.push(Path::new(".rustml/datasets/")); |
| 12 | p.push(Path::new(fname)); |
| 13 | println!("{}", p.as_path().to_str().unwrap().to_string()); |
| 14 | Ok(p.as_path().to_str().unwrap().to_string()) |
| 15 | } |
| 16 | None => Err("Could not get home directory.") |
| 17 | } |
| 18 | } |
| 19 |