mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-04-03 10:47:40 +08:00
fix: 修正restore_index()行为,从index筛选文件而非工作区
This commit is contained in:
@@ -171,10 +171,14 @@ pub fn format_time(time: &std::time::SystemTime) -> String {
|
||||
}
|
||||
|
||||
/// 过滤出路径数组中的目录
|
||||
pub fn filter_dirs(paths: &Vec<PathBuf>) -> Vec<PathBuf> {
|
||||
pub fn filter_dirs(paths: &Vec<PathBuf>) -> HashSet<PathBuf> {
|
||||
paths.iter().filter(|path| path.is_dir()).cloned().collect()
|
||||
}
|
||||
|
||||
pub fn filter_files(paths: &Vec<PathBuf>) -> HashSet<PathBuf> {
|
||||
paths.iter().filter(|path| path.is_file()).cloned().collect()
|
||||
}
|
||||
|
||||
/// 将路径中的分隔符统一为当前系统的分隔符
|
||||
fn unify_path_separator(path: &Path) -> PathBuf {
|
||||
#[cfg(windows)]
|
||||
|
||||
Reference in New Issue
Block a user