(path: &str)
| 18 | use std::path::Path; |
| 19 | |
| 20 | pub fn path_available(path: &str) -> Result<(), &'static str> { |
| 21 | if cfg!(windows) { |
| 22 | if path.chars().all(|c| c.is_ascii()) { |
| 23 | Ok(()) |
| 24 | } else { |
| 25 | Err("路径应为 ASCII,即不能包含中文或特殊字符等") |
| 26 | } |
| 27 | } else { |
| 28 | Ok(()) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | pub fn exists(path: &str) -> bool { |
| 33 | Path::new(path).join(".vscode").exists() |
no outgoing calls
no test coverage detected