Formatting

This commit is contained in:
Aleksei Voronov 2023-10-16 12:06:41 +02:00
parent f0ca7e58e8
commit 8ad19f6fa5
5 changed files with 17 additions and 9 deletions

View File

@ -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<Self> {
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?;

View File

@ -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;

View File

@ -26,7 +26,8 @@ impl TryFrom<CborValue> for PostRecord {
.remove("langs")
.map(|value| value.try_into())
.transpose()?,
reply: map.remove("reply")
reply: map
.remove("reply")
.map(|value| value.try_into())
.transpose()?,
})

View File

@ -10,7 +10,7 @@ impl From<ProfileRecord> 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(),
}
}
}