Reduce turbofish usage
Should make the code a little bit easier to read.
This commit is contained in:
@@ -112,13 +112,13 @@ pub async fn get_state_events_route(
|
||||
db.rooms
|
||||
.room_state_get(&body.room_id, &EventType::RoomHistoryVisibility, "")?
|
||||
.map(|event| {
|
||||
serde_json::from_str::<RoomHistoryVisibilityEventContent>(event.content.get())
|
||||
serde_json::from_str(event.content.get())
|
||||
.map(|e: RoomHistoryVisibilityEventContent| e.history_visibility)
|
||||
.map_err(|_| {
|
||||
Error::bad_database(
|
||||
"Invalid room history visibility event in database.",
|
||||
)
|
||||
})
|
||||
.map(|e| e.history_visibility)
|
||||
}),
|
||||
Some(Ok(HistoryVisibility::WorldReadable))
|
||||
)
|
||||
@@ -164,13 +164,13 @@ pub async fn get_state_events_for_key_route(
|
||||
db.rooms
|
||||
.room_state_get(&body.room_id, &EventType::RoomHistoryVisibility, "")?
|
||||
.map(|event| {
|
||||
serde_json::from_str::<RoomHistoryVisibilityEventContent>(event.content.get())
|
||||
serde_json::from_str(event.content.get())
|
||||
.map(|e: RoomHistoryVisibilityEventContent| e.history_visibility)
|
||||
.map_err(|_| {
|
||||
Error::bad_database(
|
||||
"Invalid room history visibility event in database.",
|
||||
)
|
||||
})
|
||||
.map(|e| e.history_visibility)
|
||||
}),
|
||||
Some(Ok(HistoryVisibility::WorldReadable))
|
||||
)
|
||||
@@ -220,13 +220,13 @@ pub async fn get_state_events_for_empty_key_route(
|
||||
db.rooms
|
||||
.room_state_get(&body.room_id, &EventType::RoomHistoryVisibility, "")?
|
||||
.map(|event| {
|
||||
serde_json::from_str::<RoomHistoryVisibilityEventContent>(event.content.get())
|
||||
serde_json::from_str(event.content.get())
|
||||
.map(|e: RoomHistoryVisibilityEventContent| e.history_visibility)
|
||||
.map_err(|_| {
|
||||
Error::bad_database(
|
||||
"Invalid room history visibility event in database.",
|
||||
)
|
||||
})
|
||||
.map(|e| e.history_visibility)
|
||||
}),
|
||||
Some(Ok(HistoryVisibility::WorldReadable))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user