MCPcopy Create free account
hub / github.com/Wulf/tsync / process_rust_file

Function process_rust_file

src/lib.rs:108–135  ·  view source on GitHub ↗
(
    input_path: P,
    state: &mut BuildState,
    config: &BuildSettings,
)

Source from the content-addressed store, hash-verified

106}
107
108fn 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
137fn check_path<P: AsRef<Path>>(path: P, state: &mut BuildState) -> bool {
138 if !path.as_ref().exists() {

Callers 2

process_dir_entryFunction · 0.85

Calls 1

process_rust_itemFunction · 0.85

Tested by

no test coverage detected