Add ability to clone accounts from an RPC endpoint

This commit is contained in:
Michael Vines
2021-01-21 13:16:40 -08:00
parent c3548f790c
commit cbb9ac19b9
3 changed files with 82 additions and 9 deletions

View File

@ -164,8 +164,8 @@ where
}
}
pub fn normalize_to_url_if_moniker(url_or_moniker: &str) -> String {
match url_or_moniker {
pub fn normalize_to_url_if_moniker<T: AsRef<str>>(url_or_moniker: T) -> String {
match url_or_moniker.as_ref() {
"m" | "mainnet-beta" => "https://api.mainnet-beta.solana.com",
"t" | "testnet" => "https://testnet.solana.com",
"d" | "devnet" => "https://devnet.solana.com",