(filename: &PathBuf, view: &core::View)
| 196 | } |
| 197 | |
| 198 | pub fn load(filename: &PathBuf, view: &core::View) -> Result<Self> { |
| 199 | let index = if view.blob_exists(filename)? { |
| 200 | match view.find_blob_by_filename(filename)? { |
| 201 | Some(blob) => Self { |
| 202 | filename: filename.to_owned(), |
| 203 | index: blob.try_into()?, |
| 204 | }, |
| 205 | None => Self::new(filename), |
| 206 | } |
| 207 | } else { |
| 208 | Self::new(filename) |
| 209 | }; |
| 210 | Ok(index) |
| 211 | } |
| 212 | |
| 213 | pub fn make(filename: PathBuf, index: SynonymIndexMap) -> Self { |
| 214 | Self { filename, index } |
nothing calls this directly
no test coverage detected