xref: /DADK/dadk-user/src/utils/path.rs (revision d2ade6ef037f43d0342021730a0d8b3af7bc36c1)
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