xref: /DADK/dadk-user/src/utils/path.rs (revision cfb7b78ff5dff2a09cba93336ba222be89cbd3e1)
1 use std::path::PathBuf;
2 
3 /// 获取给定路径的绝对路径
4 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