| 644 | } |
| 645 | |
| 646 | fn collect_nonempty_regfiles( |
| 647 | root: &Dir, |
| 648 | path: &Utf8Path, |
| 649 | out: &mut BTreeSet<Utf8PathBuf>, |
| 650 | ) -> Result<()> { |
| 651 | for entry in root.entries_utf8()? { |
| 652 | let entry = entry?; |
| 653 | let ty = entry.file_type()?; |
| 654 | let path = path.join(entry.file_name()?); |
| 655 | if ty.is_file() { |
| 656 | let meta = entry.metadata()?; |
| 657 | if meta.size() > 0 { |
| 658 | out.insert(path); |
| 659 | } |
| 660 | } else if ty.is_dir() { |
| 661 | let d = entry.open_dir()?; |
| 662 | collect_nonempty_regfiles(d.as_cap_std(), &path, out)?; |
| 663 | } |
| 664 | } |
| 665 | Ok(()) |
| 666 | } |
| 667 | |
| 668 | #[distributed_slice(LINTS)] |
| 669 | static LINT_VARLOG: Lint = Lint::new_warning( |