(fname: &str, sep: &str)
| 100 | } |
| 101 | |
| 102 | pub fn from_csv_file(fname: &str, sep: &str) -> Result<Matrix<f64>, &'static str> { |
| 103 | |
| 104 | let mut s = String::new(); |
| 105 | |
| 106 | try!( |
| 107 | try!( |
| 108 | File::open(fname).map_err(|_| "Could not open file") |
| 109 | ) |
| 110 | .read_to_string(&mut s).map_err(|_| "Could not read file.") |
| 111 | ); |
| 112 | from_csv_string(&s, sep) |
| 113 | } |
| 114 | |
| 115 | |
| 116 | #[cfg(test)] |
no test coverage detected