Make Result alias usable with any error type
This commit is contained in:
parent
f2ef5677e0
commit
91afa1e0e0
5 changed files with 13 additions and 15 deletions
|
@ -125,7 +125,7 @@ impl WildCardedDomain {
|
|||
}
|
||||
impl std::str::FromStr for WildCardedDomain {
|
||||
type Err = std::convert::Infallible;
|
||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
// maybe do some domain validation?
|
||||
Ok(if s.starts_with("*.") {
|
||||
WildCardedDomain::WildCarded(s[1..].to_owned())
|
||||
|
@ -137,7 +137,7 @@ impl std::str::FromStr for WildCardedDomain {
|
|||
}
|
||||
}
|
||||
impl<'de> Deserialize<'de> for WildCardedDomain {
|
||||
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
D: serde::de::Deserializer<'de>,
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue