diff --git a/src/processes/post_indexer.rs b/src/processes/post_indexer.rs index c8564ef..70e2a18 100644 --- a/src/processes/post_indexer.rs +++ b/src/processes/post_indexer.rs @@ -79,7 +79,7 @@ impl CommitProcessor for PostIndexer { } => { for algo in self.algos.iter_all() { if algo.should_index_post(author_did, post).await? { - info!("Received insertable post from {author_did}: {post:?}", ); + info!("Received insertable post from {author_did}: {post:?}",); self.database .insert_profile_if_it_doesnt_exist(author_did) diff --git a/src/services/bluesky/client.rs b/src/services/bluesky/client.rs index 6b6c778..edc1294 100644 --- a/src/services/bluesky/client.rs +++ b/src/services/bluesky/client.rs @@ -28,7 +28,9 @@ impl Bluesky { pub fn unauthenticated() -> Self { Self { - client: AtpServiceClient::new(AuthenticateableXrpcClient::new(Self::XRPC_HOST.to_owned())), + client: AtpServiceClient::new(AuthenticateableXrpcClient::new( + Self::XRPC_HOST.to_owned(), + )), session: None, } } @@ -36,7 +38,8 @@ impl Bluesky { pub async fn login(handle: &str, password: &str) -> Result { use atrium_api::com::atproto::server::create_session::Input; - let client = AtpServiceClient::new(AuthenticateableXrpcClient::new(Self::XRPC_HOST.to_owned())); + let client = + AtpServiceClient::new(AuthenticateableXrpcClient::new(Self::XRPC_HOST.to_owned())); let result = client .service @@ -182,9 +185,13 @@ impl Bluesky { let url = match cursor { Some(cursor) => format!( "{}/xrpc/com.atproto.sync.subscribeRepos?cursor={}", - Self::FIREHOSE_HOST, cursor + Self::FIREHOSE_HOST, + cursor + ), + None => format!( + "{}/xrpc/com.atproto.sync.subscribeRepos", + Self::FIREHOSE_HOST ), - None => format!("{}/xrpc/com.atproto.sync.subscribeRepos", Self::FIREHOSE_HOST), }; let (mut stream, _) = connect_async(url).await?; diff --git a/src/services/bluesky/entities.rs b/src/services/bluesky/entities.rs index e2b101b..2a80c54 100644 --- a/src/services/bluesky/entities.rs +++ b/src/services/bluesky/entities.rs @@ -1,11 +1,11 @@ mod follow; mod like; mod post; -mod session; mod profile; +mod session; pub use follow::FollowRecord; pub use like::LikeRecord; pub use post::PostRecord; -pub use session::Session; pub use profile::ProfileDetails; +pub use session::Session; diff --git a/src/services/bluesky/entities/post.rs b/src/services/bluesky/entities/post.rs index af8af78..3dfe10f 100644 --- a/src/services/bluesky/entities/post.rs +++ b/src/services/bluesky/entities/post.rs @@ -26,7 +26,8 @@ impl TryFrom for PostRecord { .remove("langs") .map(|value| value.try_into()) .transpose()?, - reply: map.remove("reply") + reply: map + .remove("reply") .map(|value| value.try_into()) .transpose()?, }) diff --git a/src/services/bluesky/entities/profile.rs b/src/services/bluesky/entities/profile.rs index 372c46f..a409abf 100644 --- a/src/services/bluesky/entities/profile.rs +++ b/src/services/bluesky/entities/profile.rs @@ -10,7 +10,7 @@ impl From for ProfileDetails { fn from(value: ProfileRecord) -> Self { Self { display_name: value.display_name.unwrap_or_default(), - description: value.description.unwrap_or_default() + description: value.description.unwrap_or_default(), } } }