File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -174,13 +174,14 @@ impl Client {
174174 /// * `port` - port of the electrum server
175175 pub fn new ( address : & str , port : u16 ) -> Result < Self , Error > {
176176 let ssl = address. starts_with ( "ssl://" ) ;
177- let mut inner = RawClient :: new_ssl_maybe ( address, port, ssl) ;
177+ let address = address. to_string ( ) . replace ( "ssl://" , "" ) ;
178+ let mut inner = RawClient :: new_ssl_maybe ( & address, port, ssl) ;
178179 inner. try_connect ( ) ?;
179180 Ok ( Client {
180181 inner,
181182 index : HashMap :: new ( ) ,
182183 last_id : 0 ,
183- url : address. into ( ) ,
184+ url : address,
184185 port,
185186 } )
186187 }
@@ -193,13 +194,14 @@ impl Client {
193194 /// * `port` - port of the electrum server
194195 pub fn new_local ( address : & str , port : u16 ) -> Result < Self , Error > {
195196 let ssl = address. starts_with ( "ssl://" ) ;
196- let mut inner = RawClient :: new_ssl_maybe ( address, port, ssl) . verif_certificate ( false ) ;
197+ let address = address. to_string ( ) . replace ( "ssl://" , "" ) ;
198+ let mut inner = RawClient :: new_ssl_maybe ( & address, port, ssl) . verif_certificate ( false ) ;
197199 inner. try_connect ( ) ?;
198200 Ok ( Client {
199201 inner,
200202 index : HashMap :: new ( ) ,
201203 last_id : 0 ,
202- url : address. into ( ) ,
204+ url : address,
203205 port,
204206 } )
205207 }
You can’t perform that action at this time.
0 commit comments