Construct a file runner from a CLIF file path.
(path: impl Into<PathBuf>)
| 68 | impl FileInterpreter { |
| 69 | /// Construct a file runner from a CLIF file path. |
| 70 | pub fn from_path(path: impl Into<PathBuf>) -> Result<Self, io::Error> { |
| 71 | let path = path.into(); |
| 72 | log::trace!("New file runner from path: {}:", path.to_string_lossy()); |
| 73 | let contents = fs::read_to_string(&path)?; |
| 74 | Ok(Self { |
| 75 | path: Some(path), |
| 76 | contents, |
| 77 | }) |
| 78 | } |
| 79 | |
| 80 | /// Construct a file runner from a CLIF code string. Currently only used for testing. |
| 81 | #[cfg(test)] |
nothing calls this directly
no test coverage detected