rustfmt: max-width=120

This commit is contained in:
mrbeanc
2023-12-21 20:54:12 +08:00
parent a2e9072951
commit 737917e421
7 changed files with 11 additions and 22 deletions

View File

@@ -17,8 +17,7 @@ pub fn commit(message: String, allow_empty: bool) {
let current_head = head::current_head();
let current_commit_hash = head::current_head_commit();
let mut commit =
commit::Commit::new(&index, vec![current_commit_hash.clone()], message.clone());
let mut commit = commit::Commit::new(&index, vec![current_commit_hash.clone()], message.clone());
let commit_hash = commit.save();
head::update_head_commit(&commit_hash);
@@ -26,11 +25,9 @@ pub fn commit(message: String, allow_empty: bool) {
head::Head::Branch(branch_name) => {
println!("commit to [{:?}] message{:?}", branch_name, message)
}
head::Head::Detached(commit_hash) => println!(
"Detached HEAD commit {:?} message{:?}",
commit_hash[0..7].to_string(),
message
),
head::Head::Detached(commit_hash) => {
println!("Detached HEAD commit {:?} message{:?}", commit_hash[0..7].to_string(), message)
}
}
println!("commit hash: {:?}", commit_hash);