| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/; |
| 2 | |
| 3 | use file_idrust-analyzer cargo file-id 0.2.3 crate/::FileIdrust-analyzer cargo file-id 0.2.3 FileId#; |
| 4 | |
| 5 | fn mainrust-analyzer cargo file-id 0.2.3 main().() { |
| 6 | let path = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/::argsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/args().().nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(1).expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("no path given"); |
| 7 | |
| 8 | print_file_idrust-analyzer cargo file-id 0.2.3 print_file_id().(&path); |
| 9 | } |
| 10 | |
| 11 | #[cfg(target_family = "unix")] |
| 12 | fn print_file_idrust-analyzer cargo file-id 0.2.3 print_file_id().(path: &str) { |
| 13 | print_resultrust-analyzer cargo file-id 0.2.3 print_result().(file_idrust-analyzer cargo file-id 0.2.3 crate/::get_file_idrust-analyzer cargo file-id 0.2.3 get_file_id().(path)); |
| 14 | } |
| 15 | |
| 16 | #[cfg(target_family = "windows")] |
| 17 | fn print_file_id(path: &str) { |
| 18 | print_resultrust-analyzer cargo file-id 0.2.3 print_result().(file_idrust-analyzer cargo file-id 0.2.3 crate/::get_low_res_file_id(path)); |
| 19 | print_resultrust-analyzer cargo file-id 0.2.3 print_result().(file_idrust-analyzer cargo file-id 0.2.3 crate/::get_high_res_file_id(path)); |
| 20 | } |
| 21 | |
| 22 | fn print_resultrust-analyzer cargo file-id 0.2.3 print_result().(result: iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<FileIdrust-analyzer cargo file-id 0.2.3 FileId#>) { |
| 23 | match result { |
| 24 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(file_id) => printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{file_id:?}"), |
| 25 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(error) => printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Error: {error}"), |
| 26 | } |
| 27 | } |