@@ -48,17 +48,16 @@ struct RustConfig {
4848
4949#[ derive( Deserialize ) ]
5050#[ serde( tag = "reason" , rename_all = "kebab-case" ) ]
51- enum CargoMessage < ' a > {
51+ enum CargoMessage {
5252 CompilerArtifact {
53- #[ serde( borrow) ]
54- target : CargoTarget < ' a > ,
55- filenames : Vec < & ' a str > ,
53+ target : CargoTarget ,
54+ filenames : Vec < String > ,
5655 } ,
5756}
5857
5958#[ derive( Deserialize , Debug ) ]
60- struct CargoTarget < ' a > {
61- name : & ' a str ,
59+ struct CargoTarget {
60+ name : String ,
6261}
6362
6463impl LanguageMethods for Rust {
@@ -173,14 +172,14 @@ path = 'lib.rs'
173172 } ;
174173 match msg {
175174 CargoMessage :: CompilerArtifact { target, filenames } => {
176- let lib = * filenames. iter ( ) . find ( |f| !f. ends_with ( ".rmeta" ) ) . unwrap ( ) ;
175+ let lib = filenames. iter ( ) . find ( |f| !f. ends_with ( ".rmeta" ) ) . unwrap ( ) ;
177176 if target. name == "futures" {
178- futures_rlib = Some ( lib) ;
177+ futures_rlib = Some ( lib. clone ( ) ) ;
179178 } else if target. name == "wit_bindgen" {
180- wit_bindgen_rlib = Some ( lib) ;
179+ wit_bindgen_rlib = Some ( lib. clone ( ) ) ;
181180 }
182- let dir = Path :: new ( lib) . parent ( ) . unwrap ( ) ;
183- if deps_seen. insert ( dir) {
181+ let dir = Path :: new ( & lib) . parent ( ) . unwrap ( ) ;
182+ if deps_seen. insert ( dir. to_path_buf ( ) ) {
184183 wit_bindgen_deps. push ( dir. to_path_buf ( ) ) ;
185184 }
186185 }
0 commit comments