(line: &str, alias: &str)
| 1521 | } |
| 1522 | |
| 1523 | fn host_line_matches(line: &str, alias: &str) -> bool { |
| 1524 | let trimmed = line.trim_start(); |
| 1525 | if !trimmed.starts_with("Host ") { |
| 1526 | return false; |
| 1527 | } |
| 1528 | trimmed["Host ".len()..] |
| 1529 | .split_whitespace() |
| 1530 | .any(|token| token == alias) |
| 1531 | } |
| 1532 | |
| 1533 | fn upsert_host_block(contents: &str, alias: &str, block: &str) -> String { |
| 1534 | let lines: Vec<&str> = contents.lines().collect(); |
no test coverage detected