(entry: &DirEntry)
| 103 | } |
| 104 | |
| 105 | fn should_descend(entry: &DirEntry) -> bool { |
| 106 | if !entry.file_type().is_dir() { |
| 107 | return true; |
| 108 | } |
| 109 | let name = entry.file_name().to_string_lossy(); |
| 110 | if entry.depth() == 0 { |
| 111 | return true; |
| 112 | } |
| 113 | !matches!( |
| 114 | name.as_ref(), |
| 115 | ".git" |
| 116 | | ".jj" |
| 117 | | ".svn" |
| 118 | | "node_modules" |
| 119 | | "target" |
| 120 | | "dist" |
| 121 | | "build" |
| 122 | | ".next" |
| 123 | | ".nuxt" |
| 124 | | ".turbo" |
| 125 | | ".cache" |
| 126 | | ".idea" |
| 127 | | ".vscode" |
| 128 | ) |
| 129 | } |
| 130 | |
| 131 | #[cfg(test)] |
| 132 | mod tests { |