From df855b045ec52b40140f35af782b88efa1dd6f77 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sun, 27 Mar 2022 23:37:15 +0200 Subject: [PATCH] feat: add TryFrom String reference for http provider (#1084) --- ethers-providers/src/provider.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ethers-providers/src/provider.rs b/ethers-providers/src/provider.rs index a97cc296..bb51c120 100644 --- a/ethers-providers/src/provider.rs +++ b/ethers-providers/src/provider.rs @@ -1298,6 +1298,14 @@ impl TryFrom for Provider { } } +impl<'a> TryFrom<&'a String> for Provider { + type Error = ParseError; + + fn try_from(src: &'a String) -> Result { + Provider::try_from(src.as_str()) + } +} + /// A middleware supporting development-specific JSON RPC methods /// /// # Example