autopath

Crates.ioautopath
lib.rsautopath
version0.1.0
sourcesrc
created_at2022-02-25 05:28:52.188769
updated_at2022-02-25 05:28:52.188769
descriptionrust path get
homepage
repository
max_upload_size
id539239
size5,911
(450220020)

documentation

https://docs.rs/autopath

README

autopath

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!

Related crates

Commit count: 0

cargo fmt