(val: T)
| 22 | /// Validates whether the given string is an IP |
| 23 | #[must_use] |
| 24 | pub fn validate_ip<T>(val: T) -> bool |
| 25 | where |
| 26 | T: AsRef<str>, |
| 27 | { |
| 28 | IpAddr::from_str(val.as_ref()).is_ok() |
| 29 | } |
| 30 | |
| 31 | #[cfg(test)] |
| 32 | mod tests { |
no outgoing calls
no test coverage detected