Skip to content

Commit 302fb04

Browse files
author
Luca Palmieri
committed
Implement TryFrom<&'a str> for Method, deferring to the existing implementation of FromStr.
1 parent 830331c commit 302fb04

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/method.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,11 @@ impl FromStr for Method {
8484
}
8585
}
8686
}
87+
88+
impl<'a> std::convert::TryFrom<&'a str> for Method {
89+
type Error = crate::Error;
90+
91+
fn try_from(value: &'a str) -> Result<Self, Self::Error> {
92+
Self::from_str(value)
93+
}
94+
}

0 commit comments

Comments
 (0)