@@ -62,20 +62,20 @@ impl Auditor {
6262 ) ;
6363 // If the directory is locked, print a message and wait for it to become unlocked.
6464 // If we don't print the message, `cargo audit` would just hang with no explanation.
65- if let Err ( e) = & result {
66- if e. kind ( ) == ErrorKind :: LockTimeout {
67- status_warn ! (
68- "directory {} is locked, waiting for up to {} seconds for it to become available" ,
69- advisory_db_path . display ( ) ,
70- DEFAULT_LOCK_TIMEOUT . as_secs ( )
71- ) ;
72- result = rustsec :: repository :: git :: Repository :: fetch (
73- advisory_db_url ,
74- & advisory_db_path ,
75- !config . database . stale ,
76- DEFAULT_LOCK_TIMEOUT ,
77- ) ;
78- }
65+ if let Err ( e) = & result
66+ && e. kind ( ) == ErrorKind :: LockTimeout
67+ {
68+ status_warn ! (
69+ "directory {} is locked, waiting for up to {} seconds for it to become available" ,
70+ advisory_db_path . display ( ) ,
71+ DEFAULT_LOCK_TIMEOUT . as_secs ( )
72+ ) ;
73+ result = rustsec :: repository :: git :: Repository :: fetch (
74+ advisory_db_url ,
75+ & advisory_db_path ,
76+ !config . database . stale ,
77+ DEFAULT_LOCK_TIMEOUT ,
78+ ) ;
7979 }
8080
8181 let advisory_db_repo = result. unwrap_or_else ( |e| {
@@ -122,15 +122,15 @@ impl Auditor {
122122
123123 // If the directory is locked, print a message and wait for it to become unlocked.
124124 // If we don't print the message, `cargo audit` would just hang with no explanation.
125- if let Err ( e) = & result {
126- if e. kind ( ) == ErrorKind :: LockTimeout {
127- status_warn ! (
128- "directory {} is locked, waiting for up to {} seconds for it to become available" ,
129- advisory_db_path . display ( ) ,
130- DEFAULT_LOCK_TIMEOUT . as_secs ( )
131- ) ;
132- result = registry :: CachedIndex :: fetch ( DEFAULT_LOCK_TIMEOUT ) ;
133- }
125+ if let Err ( e) = & result
126+ && e. kind ( ) == ErrorKind :: LockTimeout
127+ {
128+ status_warn ! (
129+ "directory {} is locked, waiting for up to {} seconds for it to become available" ,
130+ advisory_db_path . display ( ) ,
131+ DEFAULT_LOCK_TIMEOUT . as_secs ( )
132+ ) ;
133+ result = registry :: CachedIndex :: fetch ( DEFAULT_LOCK_TIMEOUT ) ;
134134 }
135135
136136 match result {
@@ -148,15 +148,15 @@ impl Auditor {
148148
149149 // If the directory is locked, print a message and wait for it to become unlocked.
150150 // If we don't print the message, `cargo audit` would just hang with no explanation.
151- if let Err ( e) = & result {
152- if e. kind ( ) == ErrorKind :: LockTimeout {
153- status_warn ! (
154- "directory {} is locked, waiting for up to {} seconds for it to become available" ,
155- advisory_db_path . display ( ) ,
156- DEFAULT_LOCK_TIMEOUT . as_secs ( )
157- ) ;
158- result = registry :: CachedIndex :: open ( DEFAULT_LOCK_TIMEOUT )
159- }
151+ if let Err ( e) = & result
152+ && e. kind ( ) == ErrorKind :: LockTimeout
153+ {
154+ status_warn ! (
155+ "directory {} is locked, waiting for up to {} seconds for it to become available" ,
156+ advisory_db_path . display ( ) ,
157+ DEFAULT_LOCK_TIMEOUT . as_secs ( )
158+ ) ;
159+ result = registry :: CachedIndex :: open ( DEFAULT_LOCK_TIMEOUT )
160160 }
161161
162162 match result {
0 commit comments