xref: /DADK/dadk-user/src/utils/path.rs (revision eaa67f3cf8881c221a744937c6318444b068a801)
1 use std::path::PathBuf;
2 
3 /// 获取给定路径的绝对路径
abs_path(path: &PathBuf) -> PathBuf4 pub fn abs_path(path: &PathBuf) -> PathBuf {
5     if path.is_absolute() {
6         path.to_path_buf()
7     } else {
8         std::env::current_dir().unwrap().join(path)
9     }
10 }
11