diff --git a/src/streaming.rs b/src/streaming.rs
index eb01f03..b43aa6c 100644
--- a/src/streaming.rs
+++ b/src/streaming.rs
@@ -13,32 +13,29 @@ pub async fn start_stream() -> Result<()> {
connect_async("wss://bsky.social/xrpc/com.atproto.sync.subscribeRepos").await?;
while let Some(Ok(tungstenite::Message::Binary(message))) = stream.next().await {
- let commit = match parse_commit_message(&message) {
- Ok(Some(commit)) => commit,
- Ok(None) => continue,
- Err(e) => {
- println!("Couldn't parse commit: {:?}", e);
- continue;
- }
- };
-
- let post_messages = extract_post_messages(&commit).await;
- match post_messages {
- Ok(post_messages) => {
- if !post_messages.is_empty() {
- println!("{:?}", post_messages);
- }
- }
- Err(e) => {
- println!("Coudln't extract post messages: {:?}", e);
- }
+ if let Err(e) = handle_message(&message).await {
+ println!("Error handling a message: {:?}", e);
}
}
Ok(())
}
-fn parse_commit_message(message: &[u8]) -> Result