File tree Expand file tree Collapse file tree 4 files changed +7
-2
lines changed
Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ fn clean() {
138138}
139139
140140#[ test]
141+ #[ cfg( not( target_os = "windows" ) ) ] // hash differs on windows
141142fn compress_project_tar ( ) {
142143 test ( |exercise| {
143144 let target = NamedTempFile :: new ( ) . unwrap ( ) ;
@@ -164,6 +165,7 @@ fn compress_project_tar() {
164165}
165166
166167#[ test]
168+ #[ cfg( not( target_os = "windows" ) ) ] // hash differs on windows
167169fn compress_project_zip ( ) {
168170 test ( |exercise| {
169171 let target = NamedTempFile :: new ( ) . unwrap ( ) ;
@@ -191,6 +193,7 @@ fn compress_project_zip() {
191193}
192194
193195#[ test]
196+ #[ cfg( not( target_os = "windows" ) ) ] // hash differs on windows
194197fn compress_project_zstd ( ) {
195198 test ( |exercise| {
196199 let target = NamedTempFile :: new ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use std::{
1717 ops:: { Deref , DerefMut } ,
1818 path:: { Path , PathBuf } ,
1919} ;
20- use tempfile:: NamedTempFile ;
20+ use tempfile:: { NamedTempFile , TempDir } ;
2121use walkdir:: WalkDir ;
2222
2323/// Convenience macro for locking a path.
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ impl TmcConfig {
155155 file_util:: write_to_file ( toml, temp_file. path ( ) ) ?;
156156
157157 log:: debug!( "Moving new config over old one" ) ;
158- file_util :: rename ( temp_file. path ( ) , path) ?;
158+ temp_file. persist ( path) ?;
159159 Ok ( ( ) )
160160 }
161161
Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ pub enum LangsError {
124124 Hmac ( #[ from] hmac:: digest:: InvalidLength ) ,
125125 #[ error( transparent) ]
126126 TestMyCodeClient ( #[ from] tmc_testmycode_client:: TestMyCodeClientError ) ,
127+ #[ error( transparent) ]
128+ PersistTempFile ( #[ from] tempfile:: PersistError ) ,
127129}
128130
129131/// Error validating TMC params values.
You can’t perform that action at this time.
0 commit comments