消除警告

This commit is contained in:
HouXiaoxuan
2023-12-21 19:20:34 +08:00
parent 526210b1db
commit af194c3c2c
2 changed files with 5 additions and 2 deletions

View File

@@ -25,10 +25,13 @@ pub fn add(files: Vec<String>, all: bool, mut update: bool) {
let path = if all || update { let path = if all || update {
println!("{}", "--all || --update 运行于工作区目录".bright_green()); println!("{}", "--all || --update 运行于工作区目录".bright_green());
get_working_dir().unwrap() get_working_dir().unwrap()
} else { } else if dot {
println!("{}", "'.'代表了当前目录".bright_green()); println!("{}", "'.'代表了当前目录".bright_green());
env::current_dir().unwrap() env::current_dir().unwrap()
} else {
panic!("不应该运行到这里");
}; };
println!("Working on [{}]\n", path.to_str().unwrap().bright_blue()); println!("Working on [{}]\n", path.to_str().unwrap().bright_blue());
files = list_files(&path).unwrap(); files = list_files(&path).unwrap();
if update { if update {

View File

@@ -3,7 +3,7 @@ use std::path::PathBuf;
use crate::utils::util::to_workdir_absolute_path; use crate::utils::util::to_workdir_absolute_path;
use crate::{ use crate::{
head, head,
models::{blob, commit, index}, models::{commit, index},
utils::util, utils::util,
}; };