Skip to content

Commit 863d2ad

Browse files
committed
cargo fmt
1 parent 92b7102 commit 863d2ad

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/lib.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ mod trim;
66
use trim::*;
77

88
/// Autosquash automatically squashes onto the merge base.
9-
pub fn autosquash(
10-
onto_branch: &str,
11-
) -> Result<()> {
12-
9+
pub fn autosquash(onto_branch: &str) -> Result<()> {
1310
eprint!("{}", "• Getting merge base...".yellow());
1411
let merge_base = get_merge_base(onto_branch)?;
1512
eprintln!("\r{}", "• Getting merge base...".green());
@@ -29,15 +26,21 @@ pub fn autosquash(
2926
Ok(())
3027
}
3128

32-
3329
fn get_merge_base(branch: &str) -> Result<String> {
3430
let commit = git_cwd(&["merge-base", "HEAD", &branch])?.stdout;
3531
let commit = std::str::from_utf8(commit.trim_ascii_whitespace())?;
3632
Ok(commit.to_owned())
3733
}
3834

3935
fn get_commit_messages(from: &str, to: &str) -> Result<String> {
40-
let messages = git_cwd(&["--no-pager", "log", "--reverse", "--format=%B", &format!("{}..{}", from, to)])?.stdout;
36+
let messages = git_cwd(&[
37+
"--no-pager",
38+
"log",
39+
"--reverse",
40+
"--format=%B",
41+
&format!("{}..{}", from, to),
42+
])?
43+
.stdout;
4144
let messages = std::str::from_utf8(&messages)?;
4245
Ok(messages.to_owned())
4346
}

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ fn main() -> Result<()> {
3030
fn run() -> Result<()> {
3131
let options: CliOptions = argh::from_env();
3232

33-
env_logger::Builder::new().parse_filters(&options.log.unwrap_or_default()).init();
33+
env_logger::Builder::new()
34+
.parse_filters(&options.log.unwrap_or_default())
35+
.init();
3436

3537
autosquash(&options.onto)?;
3638

0 commit comments

Comments
 (0)