Returns the extractor for a file path based on its extension.
(&self, path: &str)
| 330 | |
| 331 | /// Returns the extractor for a file path based on its extension. |
| 332 | pub fn extractor_for_file(&self, path: &str) -> Option<&dyn LanguageExtractor> { |
| 333 | let ext = path.rsplit('.').next()?; |
| 334 | self.extractors |
| 335 | .iter() |
| 336 | .find(|e| e.extensions().contains(&ext)) |
| 337 | .map(std::convert::AsRef::as_ref) |
| 338 | } |
| 339 | |
| 340 | /// Returns all supported file extensions across all extractors. |
| 341 | pub fn supported_extensions(&self) -> Vec<&str> { |
no test coverage detected