chore: add pre-commit fmt+clippy hooks, fix clippy warnings

This commit is contained in:
2026-05-17 12:09:24 +02:00
parent d813e59b5c
commit 2d1044e5c3
3 changed files with 27 additions and 7 deletions

View File

@@ -241,12 +241,12 @@ impl Activity for UndoActivity {
async fn verify(&self, _data: &Data<Self::DataType>) -> Result<(), Self::Error> {
// The actor undoing must be the same as the actor in the wrapped activity.
if let Some(inner_actor) = self.object.get("actor").and_then(|v| v.as_str()) {
if inner_actor != self.actor.inner().as_str() {
return Err(Error::bad_request(anyhow::anyhow!(
"Undo actor does not match inner activity actor"
)));
}
if let Some(inner_actor) = self.object.get("actor").and_then(|v| v.as_str())
&& inner_actor != self.actor.inner().as_str()
{
return Err(Error::bad_request(anyhow::anyhow!(
"Undo actor does not match inner activity actor"
)));
}
Ok(())
}