mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
enable match_same_arms lint
This commit is contained in:
parent
4e6c8451ca
commit
2b8b5ccb1a
6 changed files with 5 additions and 7 deletions
|
|
@ -48,6 +48,7 @@ manual_let_else = "warn"
|
||||||
manual_string_new = "warn"
|
manual_string_new = "warn"
|
||||||
map_unwrap_or = "warn"
|
map_unwrap_or = "warn"
|
||||||
match_bool = "warn"
|
match_bool = "warn"
|
||||||
|
match_same_arms = "warn"
|
||||||
mem_forget = "warn"
|
mem_forget = "warn"
|
||||||
missing_assert_message = "warn"
|
missing_assert_message = "warn"
|
||||||
mod_module_files = "warn"
|
mod_module_files = "warn"
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ pub(crate) async fn create_room_route(
|
||||||
let preset = body.preset.clone().unwrap_or(match &body.visibility {
|
let preset = body.preset.clone().unwrap_or(match &body.visibility {
|
||||||
room::Visibility::Private => RoomPreset::PrivateChat,
|
room::Visibility::Private => RoomPreset::PrivateChat,
|
||||||
room::Visibility::Public => RoomPreset::PublicChat,
|
room::Visibility::Public => RoomPreset::PublicChat,
|
||||||
_ => RoomPreset::PrivateChat, // Room visibility should not be custom
|
_ => unimplemented!("unknown room visibility"),
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut users = BTreeMap::new();
|
let mut users = BTreeMap::new();
|
||||||
|
|
|
||||||
|
|
@ -770,7 +770,6 @@ pub(crate) async fn send_transaction_message_route(
|
||||||
.filter_map(|edu| serde_json::from_str::<Edu>(edu.json().get()).ok())
|
.filter_map(|edu| serde_json::from_str::<Edu>(edu.json().get()).ok())
|
||||||
{
|
{
|
||||||
match edu {
|
match edu {
|
||||||
Edu::Presence(_) => {}
|
|
||||||
Edu::Receipt(receipt) => {
|
Edu::Receipt(receipt) => {
|
||||||
for (room_id, room_updates) in receipt.receipts {
|
for (room_id, room_updates) in receipt.receipts {
|
||||||
for (user_id, user_updates) in room_updates.read {
|
for (user_id, user_updates) in room_updates.read {
|
||||||
|
|
@ -922,7 +921,7 @@ pub(crate) async fn send_transaction_message_route(
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Edu::_Custom(_) => {}
|
Edu::_Custom(_) | Edu::Presence(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,6 @@ impl Service {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
// TODO: Handle email
|
// TODO: Handle email
|
||||||
PusherKind::Email(_) => Ok(()),
|
|
||||||
_ => Ok(()),
|
_ => Ok(()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -453,8 +453,7 @@ impl Service {
|
||||||
room_id: &RoomId,
|
room_id: &RoomId,
|
||||||
) -> Result<bool> {
|
) -> Result<bool> {
|
||||||
let allowed = match join_rule {
|
let allowed = match join_rule {
|
||||||
SpaceRoomJoinRule::Public => true,
|
SpaceRoomJoinRule::Knock | SpaceRoomJoinRule::Public => true,
|
||||||
SpaceRoomJoinRule::Knock => true,
|
|
||||||
SpaceRoomJoinRule::Invite => services()
|
SpaceRoomJoinRule::Invite => services()
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
|
|
|
||||||
|
|
@ -118,11 +118,11 @@ impl Error {
|
||||||
| Forbidden
|
| Forbidden
|
||||||
| GuestAccessForbidden
|
| GuestAccessForbidden
|
||||||
| ThreepidAuthFailed
|
| ThreepidAuthFailed
|
||||||
|
| UserDeactivated
|
||||||
| ThreepidDenied => StatusCode::FORBIDDEN,
|
| ThreepidDenied => StatusCode::FORBIDDEN,
|
||||||
Unauthorized | UnknownToken { .. } | MissingToken => StatusCode::UNAUTHORIZED,
|
Unauthorized | UnknownToken { .. } | MissingToken => StatusCode::UNAUTHORIZED,
|
||||||
NotFound | Unrecognized => StatusCode::NOT_FOUND,
|
NotFound | Unrecognized => StatusCode::NOT_FOUND,
|
||||||
LimitExceeded { .. } => StatusCode::TOO_MANY_REQUESTS,
|
LimitExceeded { .. } => StatusCode::TOO_MANY_REQUESTS,
|
||||||
UserDeactivated => StatusCode::FORBIDDEN,
|
|
||||||
TooLarge => StatusCode::PAYLOAD_TOO_LARGE,
|
TooLarge => StatusCode::PAYLOAD_TOO_LARGE,
|
||||||
_ => StatusCode::BAD_REQUEST,
|
_ => StatusCode::BAD_REQUEST,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue