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