MCPcopy Index your code
hub / github.com/RustPython/RustPython / main

Function main

examples/parse_folder.rs:18–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16};
17
18fn main() {
19 env_logger::init();
20
21 let folder: PathBuf = std::env::args_os()
22 .nth(1)
23 .expect("please pass a path argument")
24 .into();
25
26 if folder.exists() && folder.is_dir() {
27 println!("Parsing folder of python code: {folder:?}");
28 let t1 = Instant::now();
29 let parsed_files = parse_folder(&folder).unwrap();
30 let t2 = Instant::now();
31 let results = ScanResult {
32 t1,
33 t2,
34 parsed_files,
35 };
36 statistics(results);
37 } else {
38 println!("{folder:?} is not a folder.");
39 }
40}
41
42fn parse_folder(path: &Path) -> std::io::Result<Vec<ParsedFile>> {
43 let mut res = vec![];

Callers

nothing calls this directly

Calls 6

parse_folderFunction · 0.85
statisticsFunction · 0.85
initFunction · 0.50
existsMethod · 0.45
is_dirMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected