File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ fn should_skip_module<T: FormatHandler>(
82
82
let source_file = context. parse_session . span_to_file_contents ( module. span ) ;
83
83
let src = source_file. src . as_ref ( ) . expect ( "SourceFile without src" ) ;
84
84
85
- if is_generated_file ( src, config. generated_marker_line_search_limit ( ) ) {
85
+ if is_generated_file ( src, config) {
86
86
return true ;
87
87
}
88
88
}
Original file line number Diff line number Diff line change
1
+ use crate :: Config ;
2
+
1
3
/// Returns `true` if the given span is a part of generated files.
2
- pub ( super ) fn is_generated_file ( original_snippet : & str , header_size : usize ) -> bool {
4
+ pub ( super ) fn is_generated_file ( original_snippet : & str , config : & Config ) -> bool {
3
5
original_snippet
4
6
. lines ( )
5
- . take ( header_size) // looking for marker only in the beginning of the file
7
+ // looking for marker only in the beginning of the file
8
+ . take ( config. generated_marker_line_search_limit ( ) )
6
9
. any ( |line| line. contains ( "@generated" ) )
7
10
}
You can’t perform that action at this time.
0 commit comments