feat(oci-distribution): implement FromStr for Reference
use std::convert::{Into, TryFrom};
+use std::str::FromStr;
/// An OCI image reference
///
@@ -111,6 +112,14 @@ impl TryFrom<&str> for Reference {
}
}
+impl FromStr for Reference {
+ type Err = anyhow::Error;
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
+ Reference::try_from(s)
+ }
+}
+
impl Into<String> for Reference {
fn into(self) -> String {
self.whole
