diff --git a/consumer/src/utils.rs b/consumer/src/utils.rs index 09243d18..88825ba2 100644 --- a/consumer/src/utils.rs +++ b/consumer/src/utils.rs @@ -2,7 +2,7 @@ use ipld_core::cid::Cid; use serde::{Deserialize, Deserializer, Serialize, Serializer}; // see https://deer.social/profile/did:plc:63y3oh7iakdueqhlj6trojbq/post/3ltuv4skhqs2h -pub fn safe_string<'de, D: Deserializer<'de>>(deserializer: D) -> Result { +pub fn safe_string<'de, D: Deserializer<'de>>(deserializer: D) -> Result { let str = String::deserialize(deserializer)?; Ok(str.replace('\u{0000}', "")) diff --git a/lexica/src/app_bsky/actor.rs b/lexica/src/app_bsky/actor.rs index 97e4aee7..e1f9b9cd 100644 --- a/lexica/src/app_bsky/actor.rs +++ b/lexica/src/app_bsky/actor.rs @@ -48,7 +48,7 @@ impl FromStr for ChatAllowIncoming { "all" => Ok(ChatAllowIncoming::All), "none" => Ok(ChatAllowIncoming::None), "following" => Ok(ChatAllowIncoming::Following), - x => Err(format!("Unrecognized variant {}", x)), + x => Err(format!("Unrecognized variant {x}")), } } } @@ -74,7 +74,7 @@ impl FromStr for Status { fn from_str(s: &str) -> Result { match s { "app.bsky.actor.status#live" => Ok(Status::Live), - x => Err(format!("Unrecognized variant {}", x)), + x => Err(format!("Unrecognized variant {x}")), } } } diff --git a/lexica/src/com_atproto/label.rs b/lexica/src/com_atproto/label.rs index 012b6435..1c4a56e8 100644 --- a/lexica/src/com_atproto/label.rs +++ b/lexica/src/com_atproto/label.rs @@ -49,7 +49,7 @@ impl FromStr for Severity { "inform" => Ok(Severity::Inform), "alert" => Ok(Severity::Alert), "none" => Ok(Severity::None), - x => Err(format!("Unrecognized variant {}", x)), + x => Err(format!("Unrecognized variant {x}")), } } } @@ -80,7 +80,7 @@ impl FromStr for Blurs { "content" => Ok(Blurs::Content), "media" => Ok(Blurs::Media), "none" => Ok(Blurs::None), - x => Err(format!("Unrecognized variant {}", x)), + x => Err(format!("Unrecognized variant {x}")), } } } @@ -119,7 +119,7 @@ impl FromStr for LabelDefaultSetting { "warn" => Ok(LabelDefaultSetting::Warn), "hide" => Ok(LabelDefaultSetting::Hide), "show" => Ok(LabelDefaultSetting::Show), - x => Err(format!("Unrecognized variant {}", x)), + x => Err(format!("Unrecognized variant {x}")), } } } diff --git a/lexica/src/com_atproto/moderation.rs b/lexica/src/com_atproto/moderation.rs index 0d04761a..0d659cd7 100644 --- a/lexica/src/com_atproto/moderation.rs +++ b/lexica/src/com_atproto/moderation.rs @@ -46,7 +46,7 @@ impl FromStr for ReasonType { "com.atproto.moderation.defs#reasonRude" => Ok(ReasonType::Rude), "com.atproto.moderation.defs#reasonOther" => Ok(ReasonType::Other), "com.atproto.moderation.defs#reasonAppeal" => Ok(ReasonType::Appeal), - x => Err(format!("Unrecognized variant {}", x)), + x => Err(format!("Unrecognized variant {x}")), } } } @@ -77,7 +77,7 @@ impl FromStr for SubjectType { "account" => Ok(SubjectType::Account), "record" => Ok(SubjectType::Record), "chat" => Ok(SubjectType::Chat), - x => Err(format!("Unrecognized variant {}", x)), + x => Err(format!("Unrecognized variant {x}")), } } } diff --git a/parakeet/src/xrpc/extract.rs b/parakeet/src/xrpc/extract.rs index 22996d05..242e09d0 100644 --- a/parakeet/src/xrpc/extract.rs +++ b/parakeet/src/xrpc/extract.rs @@ -83,8 +83,10 @@ impl FromRequestParts for AtpAuth { match state.jwt.resolve_and_verify_jwt(hdr.token()).await { Some(claims) => match &state.did_allowlist { - Some(allowlist) if !allowlist.contains(&claims.iss) => Err((StatusCode::FORBIDDEN, "forbidden".to_string())), - _ => Ok(AtpAuth(claims.iss)) + Some(allowlist) if !allowlist.contains(&claims.iss) => { + Err((StatusCode::FORBIDDEN, "forbidden".to_string())) + } + _ => Ok(AtpAuth(claims.iss)), }, None => Err((StatusCode::INTERNAL_SERVER_ERROR, "JWT error".to_string())), } @@ -110,8 +112,10 @@ impl OptionalFromRequestParts for AtpAuth { match state.jwt.resolve_and_verify_jwt(hdr.token()).await { Some(claims) => match &state.did_allowlist { - Some(allowlist) if !allowlist.contains(&claims.iss) => Err((StatusCode::FORBIDDEN, "forbidden".to_string())), - _ => Ok(Some(AtpAuth(claims.iss))) + Some(allowlist) if !allowlist.contains(&claims.iss) => { + Err((StatusCode::FORBIDDEN, "forbidden".to_string())) + } + _ => Ok(Some(AtpAuth(claims.iss))), }, None => Err((StatusCode::INTERNAL_SERVER_ERROR, "JWT error".to_string())), }