diff --git a/src/mac.rs b/src/mac.rs index 8f61141..1733b70 100644 --- a/src/mac.rs +++ b/src/mac.rs @@ -45,7 +45,7 @@ pub struct MacAddress { impl MacAddress { pub fn from_string(s: &str) -> Result { - let split: Result, _> = s.split(":") + let split: Result, _> = s.split(|c| c == ':' || c == '-') .map(|b| u8::from_str_radix(b, 16)) .collect(); match split {