feat: add TryFrom String reference for http provider (#1084)

This commit is contained in:
Matthias Seitz 2022-03-27 23:37:15 +02:00 committed by GitHub
parent c8ce673e94
commit df855b045e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -1298,6 +1298,14 @@ impl TryFrom<String> for Provider<HttpProvider> {
}
}
impl<'a> TryFrom<&'a String> for Provider<HttpProvider> {
type Error = ParseError;
fn try_from(src: &'a String) -> Result<Self, Self::Error> {
Provider::try_from(src.as_str())
}
}
/// A middleware supporting development-specific JSON RPC methods
///
/// # Example