Skip to content

Commit fb89e8c

Browse files
committed
refactor: simplify get_source_files
1 parent 118335e commit fb89e8c

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

rewatch/src/build/packages.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -531,18 +531,20 @@ pub fn get_source_files(
531531

532532
let path_dir = Path::new(&source.dir);
533533
let is_type_dev = source.is_type_dev();
534-
match build_dev_deps {
535-
false if is_type_dev => (),
536-
_ => match read_folders(filter, package_dir, path_dir, recurse, is_type_dev) {
537-
Ok(files) => map.extend(files),
538-
539-
Err(_e) => log::error!(
540-
"Could not read folder: {:?}. Specified in dependency: {}, located {:?}...",
541-
path_dir.to_path_buf().into_os_string(),
542-
package_name,
543-
package_dir
544-
),
545-
},
534+
535+
if !build_dev_deps && is_type_dev {
536+
return map;
537+
}
538+
539+
match read_folders(filter, package_dir, path_dir, recurse, is_type_dev) {
540+
Ok(files) => map.extend(files),
541+
542+
Err(_e) => log::error!(
543+
"Could not read folder: {:?}. Specified in dependency: {}, located {:?}...",
544+
path_dir.to_path_buf().into_os_string(),
545+
package_name,
546+
package_dir
547+
),
546548
};
547549

548550
map

0 commit comments

Comments
 (0)