(
input_path: P,
state: &mut BuildState,
config: &BuildSettings,
)
| 106 | } |
| 107 | |
| 108 | fn process_rust_file<P: AsRef<Path>>( |
| 109 | input_path: P, |
| 110 | state: &mut BuildState, |
| 111 | config: &BuildSettings, |
| 112 | ) { |
| 113 | if *DEBUG.get() { |
| 114 | println!("processing rust file: {:?}", input_path.as_ref().to_str()); |
| 115 | } |
| 116 | |
| 117 | let Ok(src) = std::fs::read_to_string(input_path.as_ref()) else { |
| 118 | state |
| 119 | .unprocessed_files |
| 120 | .push(input_path.as_ref().to_path_buf()); |
| 121 | return; |
| 122 | }; |
| 123 | |
| 124 | let Ok(syntax) = syn::parse_file(&src) else { |
| 125 | state |
| 126 | .unprocessed_files |
| 127 | .push(input_path.as_ref().to_path_buf()); |
| 128 | return; |
| 129 | }; |
| 130 | |
| 131 | syntax |
| 132 | .items |
| 133 | .into_iter() |
| 134 | .for_each(|item| process_rust_item(item, state, config)) |
| 135 | } |
| 136 | |
| 137 | fn check_path<P: AsRef<Path>>(path: P, state: &mut BuildState) -> bool { |
| 138 | if !path.as_ref().exists() { |
no test coverage detected