MCPcopy Create free account
hub / github.com/bootc-dev/bootc / collect_nonempty_regfiles

Function collect_nonempty_regfiles

crates/lib/src/lints.rs:646–666  ·  view source on GitHub ↗
(
    root: &Dir,
    path: &Utf8Path,
    out: &mut BTreeSet<Utf8PathBuf>,
)

Source from the content-addressed store, hash-verified

644}
645
646fn 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)]
669static LINT_VARLOG: Lint = Lint::new_warning(

Callers 1

check_varlogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected