File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
sdk/identity/azure_identity/src/credentials Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -196,20 +196,19 @@ mod tests {
196196 env,
197197 fs:: File ,
198198 io:: Write ,
199- time:: { SystemTime , UNIX_EPOCH } ,
199+ sync:: atomic:: { AtomicUsize , Ordering } ,
200+ time:: SystemTime ,
200201 } ;
201202
203+ static TEMP_FILE_COUNTER : AtomicUsize = AtomicUsize :: new ( 0 ) ;
204+
202205 pub struct TempFile {
203206 pub path : PathBuf ,
204207 }
205208
206209 impl TempFile {
207210 pub fn new ( content : & str ) -> Self {
208- let n = SystemTime :: now ( )
209- . duration_since ( UNIX_EPOCH )
210- . unwrap ( )
211- // cspell:disable-next-line
212- . subsec_nanos ( ) ;
211+ let n = TEMP_FILE_COUNTER . fetch_add ( 1 , Ordering :: SeqCst ) ;
213212 let path = env:: temp_dir ( ) . join ( format ! ( "azure_identity_test_{}" , n) ) ;
214213 File :: create ( & path)
215214 . expect ( "create temp file" )
You can’t perform that action at this time.
0 commit comments