fix: clippy warnings, clean up accept.rs
This commit is contained in:
@@ -51,11 +51,7 @@ impl Activity for AcceptActivity {
|
||||
.ok_or_else(|| Error::bad_request(anyhow::anyhow!("invalid actor URL in Follow")))?;
|
||||
let remote_actor_url = self.actor.inner().as_str().to_string();
|
||||
data.follow_repo
|
||||
.update_following_status(
|
||||
local_user_id,
|
||||
&remote_actor_url,
|
||||
FollowingStatus::Accepted,
|
||||
)
|
||||
.update_following_status(local_user_id, &remote_actor_url, FollowingStatus::Accepted)
|
||||
.await?;
|
||||
tracing::info!(remote_actor = %remote_actor_url, "follow accepted by remote");
|
||||
|
||||
|
||||
@@ -119,11 +119,11 @@ impl ActorUrls {
|
||||
fn build(base_url: &str, user_id: uuid::Uuid) -> Self {
|
||||
let ap_id = crate::urls::actor_url(base_url, user_id);
|
||||
Self {
|
||||
inbox_url: Url::parse(&format!("{}/inbox", &ap_id)).expect("valid url"),
|
||||
inbox_url: Url::parse(&format!("{}/inbox", ap_id)).expect("valid url"),
|
||||
shared_inbox_url: Url::parse(&format!("{}/inbox", base_url)).ok(),
|
||||
outbox_url: Url::parse(&format!("{}/outbox", &ap_id)).expect("valid url"),
|
||||
followers_url: Url::parse(&format!("{}/followers", &ap_id)).expect("valid url"),
|
||||
following_url: Url::parse(&format!("{}/following", &ap_id)).expect("valid url"),
|
||||
outbox_url: Url::parse(&format!("{}/outbox", ap_id)).expect("valid url"),
|
||||
followers_url: Url::parse(&format!("{}/followers", ap_id)).expect("valid url"),
|
||||
following_url: Url::parse(&format!("{}/following", ap_id)).expect("valid url"),
|
||||
ap_id,
|
||||
}
|
||||
}
|
||||
@@ -285,7 +285,7 @@ impl Object for DbActor {
|
||||
|
||||
async fn into_json(self, data: &Data<Self::DataType>) -> Result<Self::Kind, Self::Error> {
|
||||
let public_key = PublicKey {
|
||||
id: format!("{}#main-key", &self.ap_id),
|
||||
id: format!("{}#main-key", self.ap_id),
|
||||
owner: self.ap_id.clone(),
|
||||
public_key_pem: self.public_key_pem.clone(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user