From 08df36b5419c2db9a3c6e24bd5679b8eddf8a5c6 Mon Sep 17 00:00:00 2001 From: Roland Rodriguez Date: Sat, 29 Jun 2024 09:30:54 -0600 Subject: [PATCH] fix(repository): fix async spawn formatting Corrects the formatting of an async block in the GitRepository implementation. Adds missing space in the tokio::spawn async block. Ensures consistent code formatting and readability. BUG FIX: You appear to have made one or more backward-compatible bug fixes. According to Semantic Versioning (SemVer), this requires a patch version update. Please verify and update your version number accordingly. --- src/actors/repositories.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/actors/repositories.rs b/src/actors/repositories.rs index 94b1424..01d310d 100644 --- a/src/actors/repositories.rs +++ b/src/actors/repositories.rs @@ -114,7 +114,10 @@ impl GitRepository { }) .expect("Failed to print diff"); let changes = String::from_utf8_lossy(&diff_text).to_string(); - + if changes.is_empty() { + error!("No diff for file: {}",&event.message.path.display().to_string()); + return Context::noop(); + } let repository_event = BrokerRequest::new(DiffQueued::new( changes, target_file.clone(), @@ -240,7 +243,7 @@ impl GitRepository { let path = file.clone(); let trace_id = id.clone(); let repository_event = FileChangeDetected::new(file.into()); - tokio::spawn(async move{ + tokio::spawn(async move { outbound_envelope.reply_async(repository_event, None).await; }); trace!(