We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c2f0819 + 302fb04 commit d094d34Copy full SHA for d094d34
src/headers/header_value.rs
@@ -82,6 +82,14 @@ impl FromStr for HeaderValue {
82
}
83
84
85
+impl<'a> std::convert::TryFrom<&'a str> for HeaderValue {
86
+ type Error = Error;
87
+
88
+ fn try_from(value: &'a str) -> Result<Self, Self::Error> {
89
+ Self::from_str(value)
90
+ }
91
+}
92
93
impl Display for HeaderValue {
94
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
95
write!(f, "{}", self.inner)
src/method.rs
@@ -84,3 +84,11 @@ impl FromStr for Method {
+impl<'a> std::convert::TryFrom<&'a str> for Method {
+ type Error = crate::Error;
0 commit comments