(material: &HashMap<String, String>, keys: &[&str])
| 666 | } |
| 667 | |
| 668 | fn material_value(material: &HashMap<String, String>, keys: &[&str]) -> Option<String> { |
| 669 | for key in keys { |
| 670 | if let Some(value) = material.get(*key).map(|value| value.trim()) |
| 671 | && !value.is_empty() |
| 672 | { |
| 673 | return Some(value.to_string()); |
| 674 | } |
| 675 | } |
| 676 | None |
| 677 | } |
| 678 | |
| 679 | fn is_loopback_host(host: &str) -> bool { |
| 680 | matches!(host, "localhost" | "127.0.0.1" | "::1") |
no test coverage detected