@@ -2,18 +2,14 @@ use std::collections::HashSet;
22use std:: path:: Path ;
33
44use codespan_reporting:: diagnostic:: { Diagnostic , Label } ;
5- use ignore:: overrides:: Override ;
65
6+ use crate :: check:: manifest:: Manifest ;
77use crate :: check:: path:: PackagePath ;
88use crate :: check:: Diagnostics ;
99
10- pub fn check_files (
11- diags : & mut Diagnostics ,
12- package_dir : & Path ,
13- exclude : & Override ,
14- thumbnail_path : Option < PackagePath > ,
15- ) {
16- let thumbnail_path = thumbnail_path. as_ref ( ) . map ( PackagePath :: as_path) ;
10+ pub fn check ( diags : & mut Diagnostics , package_dir : & Path , manifest : & Manifest ) {
11+ let exclude = & manifest. package . exclude ;
12+ let thumbnail_path = manifest. thumbnail ( ) ;
1713
1814 // Manually keep track of excluded directories, to figure out if nested
1915 // files are ignored. This is done, so we can generate diagnostics for
@@ -39,13 +35,12 @@ pub fn check_files(
3935 }
4036
4137 // The thumbnail is always excluded.
42- let is_thumbnail = Some ( file_path ) == thumbnail_path ;
38+ let is_thumbnail = thumbnail_path . is_some_and ( |t| t . val == file_path ) ;
4339 let excluded = is_thumbnail
4440 || parent_is_excluded ( & excluded_dirs, file_path)
4541 || exclude. matched ( file_path. relative ( ) , false ) . is_ignore ( ) ;
4642
4743 forbid_font_files ( diags, file_path) ;
48-
4944 exclude_large_files ( diags, file_path, excluded, metadata. len ( ) ) ;
5045 exclude_examples_and_tests ( diags, file_path, excluded) ;
5146 }
0 commit comments