Debian Codegraph @

bin/file_id.rs

raw symbols SCIP
1 use std::io;
2
3 use file_id::FileId;
4
5 fn main() {
6 let path = std::env::args().nth(1).expect("no path given");
7
8 print_file_id(&path);
9 }
10
11 #[cfg(target_family = "unix")]
12 fn print_file_id(path: &str) {
13 print_result(file_id::get_file_id(path));
14 }
15
16 #[cfg(target_family = "windows")]
17 fn print_file_id(path: &str) {
18 print_result(file_id::get_low_res_file_id(path));
19 print_result(file_id::get_high_res_file_id(path));
20 }
21
22 fn print_result(result: io::Result<FileId>) {
23 match result {
24 Ok(file_id) => println!("{file_id:?}"),
25 Err(error) => println!("Error: {error}"),
26 }
27 }