diff --git a/src/uuid.rs b/src/uuid.rs index 70560361..c747fffb 100644 --- a/src/uuid.rs +++ b/src/uuid.rs @@ -135,7 +135,10 @@ #[cfg(test)] mod test; -use std::fmt::{self, Display}; +use std::{ + fmt::{self, Display}, + str::FromStr, +}; use crate::{ error::{Error, Result}, @@ -210,6 +213,14 @@ impl Default for Uuid { } } +impl FromStr for Uuid { + type Err = Error; + + fn from_str(s: &str) -> std::result::Result { + Self::parse_str(s) + } +} + #[cfg(feature = "uuid-1")] #[cfg_attr(docsrs, doc(cfg(feature = "uuid-1")))] impl Uuid {