@@ -236,7 +236,7 @@ async fn core(dir: PathBuf) -> Result<i32, Error> {
236236 // To allow exclusions to work sanely, we have to manually resolve the file tree
237237 if entry. is_dir ( ) {
238238 // The `notify` crate internally follows symlinks, so we do here too
239- for entry in WalkDir :: new ( & entry) . follow_links ( true ) {
239+ for entry in WalkDir :: new ( entry) . follow_links ( true ) {
240240 let entry = entry
241241 . map_err ( |err| WatchError :: ReadCustomDirEntryFailed { source : err } ) ?;
242242 let entry = entry. path ( ) ;
@@ -296,16 +296,14 @@ async fn core(dir: PathBuf) -> Result<i32, Error> {
296296 } ) ?;
297297 }
298298 }
299- } else {
300- if !file_watch_excludes. contains ( & entry) {
301- watcher
302- // The recursivity flag here will be irrelevant in all cases
303- . watch ( & entry, RecursiveMode :: Recursive )
304- . map_err ( |err| WatchError :: WatchFileFailed {
305- filename : entry. to_string_lossy ( ) . to_string ( ) ,
306- source : err,
307- } ) ?;
308- }
299+ } else if !file_watch_excludes. contains ( & entry) {
300+ watcher
301+ // The recursivity flag here will be irrelevant in all cases
302+ . watch ( & entry, RecursiveMode :: Recursive )
303+ . map_err ( |err| WatchError :: WatchFileFailed {
304+ filename : entry. to_string_lossy ( ) . to_string ( ) ,
305+ source : err,
306+ } ) ?;
309307 }
310308 }
311309 // Watch any other files/directories the user has nominated (pre-canonicalized
@@ -314,7 +312,7 @@ async fn core(dir: PathBuf) -> Result<i32, Error> {
314312 // To allow exclusions to work sanely, we have to manually resolve the file tree
315313 if entry. is_dir ( ) {
316314 // The `notify` crate internally follows symlinks, so we do here too
317- for entry in WalkDir :: new ( & entry) . follow_links ( true ) {
315+ for entry in WalkDir :: new ( entry) . follow_links ( true ) {
318316 let entry = entry
319317 . map_err ( |err| WatchError :: ReadCustomDirEntryFailed { source : err } ) ?;
320318 if entry. path ( ) . is_dir ( ) {
@@ -337,16 +335,14 @@ async fn core(dir: PathBuf) -> Result<i32, Error> {
337335 } ) ?;
338336 }
339337 }
340- } else {
341- if !file_watch_excludes. contains ( & entry) {
342- watcher
343- // The recursivity flag here will be irrelevant in all cases
344- . watch ( & entry, RecursiveMode :: Recursive )
345- . map_err ( |err| WatchError :: WatchFileFailed {
346- filename : entry. to_string_lossy ( ) . to_string ( ) ,
347- source : err,
348- } ) ?;
349- }
338+ } else if !file_watch_excludes. contains ( entry) {
339+ watcher
340+ // The recursivity flag here will be irrelevant in all cases
341+ . watch ( entry, RecursiveMode :: Recursive )
342+ . map_err ( |err| WatchError :: WatchFileFailed {
343+ filename : entry. to_string_lossy ( ) . to_string ( ) ,
344+ source : err,
345+ } ) ?;
350346 }
351347 }
352348
@@ -462,8 +458,7 @@ async fn core_watch(dir: PathBuf, opts: Opts) -> Result<i32, Error> {
462458 delete_artifacts ( dir. clone ( ) , "static" ) ?;
463459 delete_artifacts ( dir. clone ( ) , "mutable" ) ?;
464460 }
465- let exit_code = test ( dir, & test_opts, & tools, & opts) ?;
466- exit_code
461+ test ( dir, test_opts, & tools, & opts) ?
467462 }
468463 Subcommand :: Clean => {
469464 delete_dist ( dir) ?;
0 commit comments