diff options
Diffstat (limited to 'fleet')
-rw-r--r-- | fleet/pkgs/naut/src/main.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/fleet/pkgs/naut/src/main.rs b/fleet/pkgs/naut/src/main.rs index 361c212..ed38a96 100644 --- a/fleet/pkgs/naut/src/main.rs +++ b/fleet/pkgs/naut/src/main.rs @@ -42,7 +42,7 @@ async fn main() -> Result<()> { spawn(async move { if let Err(e) = conn.await { - eprintln!("Failed to handle request: {}", e); + eprintln!("Failed to handle request: {e}"); } }); } @@ -115,14 +115,14 @@ async fn handle( if r#ref.is_branch() { if new.is_zero() { - lines.push(format!("branch {} deleted (was {})", ref_name, old)); + lines.push(format!("branch {ref_name} deleted (was {old})")); } else { let mut walker = repo.revwalk()?; walker.set_sorting(Sort::REVERSE)?; walker.push(new)?; if old.is_zero() { - lines.push(format!("new branch created: {}", ref_name)); + lines.push(format!("new branch created: {ref_name}")); // We cannot use repo.head directly, as that comes resolved already. let head = repo.find_reference("HEAD")?; @@ -157,14 +157,13 @@ async fn handle( if !commits.is_empty() { lines.push(format!( - "{} {} pushed to {}", + "{} {} pushed to {ref_name}", commits.len(), if commits.len() == 1 { "commit" } else { "commits" }, - ref_name )); for commit in commits { @@ -178,16 +177,13 @@ async fn handle( } } } else if r#ref.is_tag() { - if new.is_zero() { - lines.push(format!("tag {} deleted (was {})", ref_name, old)) + lines.push(if new.is_zero() { + format!("tag {ref_name} deleted (was {old})") } else if old.is_zero() { - lines.push(format!("commit {} tagged as {}", new, ref_name)) + format!("commit {new} tagged as {ref_name}") } else { - lines.push(format!( - "tag {} modified (was {}, now {})", - ref_name, old, new - )) - } + format!("tag {ref_name} modified (was {old}, now {new})") + }); } else { return Err(anyhow!( "Received a reference that's neither a branch nor tag: {}", |