Crates.io | autopath |
lib.rs | autopath |
version | 0.1.0 |
source | src |
created_at | 2022-02-25 05:28:52.188769 |
updated_at | 2022-02-25 05:28:52.188769 |
description | rust path get |
homepage | |
repository | |
max_upload_size | |
id | 539239 |
size | 5,911 |
autopath
autoload 的附属包
#[test]
fn test_path(){
let a_p = "C:/Users/Joinz/.cargo/registry/src/github.com-1ecxxxxx9ec823/autocall-0.1.6/src/lib.rs".to_string();
let b_p = "rscontr/src/lib.rs".to_string();
let c_p = "src/lib.rs".to_string();
let a= get_caller_file_path(a_p.clone());
let b= get_caller_file_path(b_p.clone());
let c= get_caller_file_path(c_p.clone());
println!(" a:{} \n b:{} \n c:{}",a,b,c);
let a= get_caller_path(a_p.clone());
let b= get_caller_path(b_p.clone());
let c= get_caller_path(c_p.clone());
println!(" a:{} \n b:{} \n c:{}",a,b,c);
let e = get_lib_crate_path();
let f = get_work_path();
println!("e:{} ,f:{}",e,f);
}
More patterns and use-cases are in the docs!