MCPcopy Create free account
hub / github.com/daniel-e/rustml / path_for

Function path_for

src/consts.rs:7–18  ·  view source on GitHub ↗
(fname: &str)

Source from the content-addressed store, hash-verified

5pub static MNIST_PATH: &'static str = ".rustml/datasets/mnist_digits";
6
7pub 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

Callers 1

mainFunction · 0.85

Calls 1

to_stringMethod · 0.80

Tested by

no test coverage detected