@@ -215,12 +215,11 @@ impl Solc {
215215 #[ instrument( skip_all) ]
216216 #[ cfg( feature = "svm-solc" ) ]
217217 pub fn find_svm_installed_version ( version : & Version ) -> Result < Option < Self > > {
218- let version = Version :: new ( version. major , version. minor , version. patch ) ;
219218 let solc = svm:: version_binary ( & version. to_string ( ) ) ;
220219 if !solc. is_file ( ) {
221220 return Ok ( None ) ;
222221 }
223- Ok ( Some ( Self :: new_with_version ( & solc, version) ) )
222+ Ok ( Some ( Self :: new_with_version ( & solc, version. clone ( ) ) ) )
224223 }
225224
226225 /// Returns the directory in which [svm](https://github.com/roynalnaruto/svm-rs) stores all versions
@@ -294,25 +293,18 @@ impl Solc {
294293 #[ cfg( test) ]
295294 crate :: take_solc_installer_lock!( _lock) ;
296295
297- let version = if version. pre . is_empty ( ) {
298- Version :: new ( version. major , version. minor , version. patch )
299- } else {
300- // Preserve version if it is a prerelease.
301- version. clone ( )
302- } ;
303-
304296 trace ! ( "blocking installing solc version \" {}\" " , version) ;
305- crate :: report:: solc_installation_start ( & version) ;
297+ crate :: report:: solc_installation_start ( version) ;
306298 // The async version `svm::install` is used instead of `svm::blocking_install`
307299 // because the underlying `reqwest::blocking::Client` does not behave well
308300 // inside of a Tokio runtime. See: https://github.com/seanmonstar/reqwest/issues/1017
309- match RuntimeOrHandle :: new ( ) . block_on ( svm:: install ( & version) ) {
301+ match RuntimeOrHandle :: new ( ) . block_on ( svm:: install ( version) ) {
310302 Ok ( path) => {
311- crate :: report:: solc_installation_success ( & version) ;
303+ crate :: report:: solc_installation_success ( version) ;
312304 Ok ( Self :: new_with_version ( path, version. clone ( ) ) )
313305 }
314306 Err ( err) => {
315- crate :: report:: solc_installation_error ( & version, & err. to_string ( ) ) ;
307+ crate :: report:: solc_installation_error ( version, & err. to_string ( ) ) ;
316308 Err ( err)
317309 }
318310 }
0 commit comments