File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ path = "main.rs"
4646 manifest. push_str ( dep) ;
4747 manifest. push ( '\n' ) ;
4848 }
49- }
49+ }
5050 fs:: write ( "Cargo.toml" , manifest) . context ( "writing Cargo.toml" )
5151}
5252
@@ -58,9 +58,18 @@ fn set_sources(config: &mut Config) -> anyhow::Result<()> {
5858 Ok ( ( ) )
5959}
6060
61+ fn remove_file_if_exists ( path : & Path ) -> anyhow:: Result < ( ) > {
62+ match fs:: remove_file ( path) {
63+ Err ( e) if e. kind ( ) == std:: io:: ErrorKind :: NotFound => Ok ( ( ) ) ,
64+ x => x,
65+ }
66+ . context ( "removing file" )
67+ }
68+
6169pub ( crate ) fn prepare ( config : & mut Config ) -> anyhow:: Result < ( ) > {
6270 dump_lib ( ) ?;
6371 set_sources ( config) ?;
72+ remove_file_if_exists ( Path :: new ( "Cargo.lock" ) ) ?;
6473 dump_cargo_manifest ( & config. qltest_dependencies ) ?;
6574 if config. qltest_cargo_check {
6675 let status = Command :: new ( "cargo" )
You can’t perform that action at this time.
0 commit comments