fix: compile error

This commit is contained in:
2020-12-30 00:33:34 +08:00
parent 5a1c113597
commit 227dfd41ed

View File

@@ -1,6 +1,6 @@
use std::fs; use std::fs;
use clap::{ArgMatches, SubCommand, App, Arg}; use clap::{ArgMatches, SubCommand, App, Arg};
use rust_util::{util_git, util_os}; use rust_util::{util_git, util_file};
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
use crate::cmd::{Command, CommandResult}; use crate::cmd::{Command, CommandResult};
@@ -49,7 +49,7 @@ impl Command for CommandImpl {
let allow_master = sub_arg_matches.is_present("allow-master"); let allow_master = sub_arg_matches.is_present("allow-master");
let git_check_json = match dir { let git_check_json = match dir {
None => GIT_CHECK_JSON.to_string(), None => GIT_CHECK_JSON.to_string(),
Some(dir) => util_os::join_path(dir.to_string(), GIT_CHECK_JSON), Some(dir) => util_file::join_path(dir, GIT_CHECK_JSON),
}; };
let git_check_config = match fs::read_to_string(&git_check_json) { let git_check_config = match fs::read_to_string(&git_check_json) {
Ok(s) => serde_json::from_str::<GitCheckConfig>(&s).expect(&format!("Parse file failed: {}", GIT_CHECK_JSON)), Ok(s) => serde_json::from_str::<GitCheckConfig>(&s).expect(&format!("Parse file failed: {}", GIT_CHECK_JSON)),