Function
directive_value
(
reader: &BenchmarkFileReader,
line: &'a str,
directive: &str,
message: &str,
)
Source from the content-addressed store, hash-verified
| 1220 | // ---- utility function below |
| 1221 | |
| 1222 | fn directive_value<'a>( |
| 1223 | reader: &BenchmarkFileReader, |
| 1224 | line: &'a str, |
| 1225 | directive: &str, |
| 1226 | message: &str, |
| 1227 | ) -> Result<&'a str> { |
| 1228 | let value = line |
| 1229 | .get(..directive.len()) |
| 1230 | .filter(|prefix| prefix.eq_ignore_ascii_case(directive)) |
| 1231 | .and_then(|_| line.get(directive.len()..)) |
| 1232 | .map(str::trim) |
| 1233 | .filter(|s| !s.is_empty()) |
| 1234 | .ok_or_else(|| exec_datafusion_err!("{}", reader.format_exception(message)))?; |
| 1235 | |
| 1236 | Ok(value) |
| 1237 | } |
| 1238 | |
| 1239 | fn parse_group_from_path(path: &Path, benchmark_directory: &Path) -> String { |
| 1240 | let mut group_name = String::new(); |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…