clippy allow -> expect
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#![allow(
|
||||
#![expect(
|
||||
clippy::cast_possible_wrap,
|
||||
clippy::cast_sign_loss,
|
||||
clippy::as_conversions
|
||||
|
||||
@@ -22,11 +22,9 @@ impl<E: Event> RoomCreateEvent<E> {
|
||||
pub fn new(event: E) -> Self { Self(event) }
|
||||
|
||||
/// The version of the room.
|
||||
#[allow(dead_code)]
|
||||
pub fn room_version(&self) -> Result<RoomVersionId> {
|
||||
#[derive(Deserialize)]
|
||||
struct RoomCreateContentRoomVersion {
|
||||
#[allow(dead_code)]
|
||||
room_version: Option<RoomVersionId>,
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ where
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
#[allow(clippy::redundant_closure)]
|
||||
#[expect(clippy::redundant_closure)]
|
||||
#[tracing::instrument(level = "trace", skip_all)]
|
||||
async fn get_power_levels_auth_event<Fetch, Fut, Pdu>(
|
||||
event: &Pdu,
|
||||
|
||||
@@ -652,7 +652,7 @@ async fn join_rule_with_auth_chain() {
|
||||
do_check(&join_rule.values().cloned().collect::<Vec<_>>(), edges, expected_state_ids).await;
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn BAN_STATE_SET() -> HashMap<OwnedEventId, PduEvent> {
|
||||
vec![
|
||||
to_pdu_event(
|
||||
@@ -697,7 +697,7 @@ fn BAN_STATE_SET() -> HashMap<OwnedEventId, PduEvent> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn JOIN_RULE() -> HashMap<OwnedEventId, PduEvent> {
|
||||
vec![
|
||||
to_pdu_event(
|
||||
@@ -726,7 +726,7 @@ fn JOIN_RULE() -> HashMap<OwnedEventId, PduEvent> {
|
||||
|
||||
macro_rules! state_set {
|
||||
($($kind:expr => $key:expr => $id:expr),* $(,)?) => {{
|
||||
#[allow(unused_mut)]
|
||||
#[expect(unused_mut)]
|
||||
let mut x = StateMap::new();
|
||||
$(
|
||||
x.insert(($kind, $key.into()), $id);
|
||||
|
||||
@@ -75,7 +75,7 @@ impl PartialOrd for TieBreaker<'_> {
|
||||
graph = graph.len(),
|
||||
)
|
||||
)]
|
||||
#[allow(clippy::implicit_hasher)]
|
||||
#[expect(clippy::implicit_hasher)]
|
||||
pub async fn topological_sort<Query, Fut>(
|
||||
graph: &HashMap<OwnedEventId, HashSet<OwnedEventId>>,
|
||||
query: &Query,
|
||||
|
||||
@@ -248,7 +248,7 @@ pub(super) async fn do_check(
|
||||
assert_eq!(expected_state, end_state);
|
||||
}
|
||||
|
||||
#[allow(clippy::exhaustive_structs)]
|
||||
#[expect(clippy::exhaustive_structs)]
|
||||
pub(super) struct TestStore(pub(super) HashMap<OwnedEventId, PduEvent>);
|
||||
|
||||
impl TestStore {
|
||||
@@ -286,7 +286,7 @@ impl TestStore {
|
||||
}
|
||||
|
||||
// A StateStore implementation for testing
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[expect(clippy::type_complexity)]
|
||||
impl TestStore {
|
||||
pub(super) fn set_up(
|
||||
&mut self,
|
||||
@@ -646,7 +646,7 @@ pub(super) fn room_create_hydra_pdu_event(
|
||||
}
|
||||
|
||||
// all graphs start with these input events
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
pub(super) fn INITIAL_EVENTS() -> HashMap<OwnedEventId, PduEvent> {
|
||||
vec![
|
||||
to_pdu_event::<&EventId>(
|
||||
@@ -729,7 +729,7 @@ pub(super) fn INITIAL_EVENTS() -> HashMap<OwnedEventId, PduEvent> {
|
||||
|
||||
/// Batch of initial events to use for incoming events from room version
|
||||
/// `org.matrix.hydra.11` onwards.
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
pub(super) fn INITIAL_HYDRA_EVENTS() -> HashMap<OwnedEventId, PduEvent> {
|
||||
vec![
|
||||
room_create_hydra_pdu_event(
|
||||
@@ -807,7 +807,7 @@ pub(super) fn INITIAL_HYDRA_EVENTS() -> HashMap<OwnedEventId, PduEvent> {
|
||||
}
|
||||
|
||||
// all graphs start with these input events
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
pub(super) fn INITIAL_EVENTS_CREATE_ROOM() -> HashMap<OwnedEventId, PduEvent> {
|
||||
vec![to_pdu_event::<&EventId>(
|
||||
"CREATE",
|
||||
@@ -823,7 +823,7 @@ pub(super) fn INITIAL_EVENTS_CREATE_ROOM() -> HashMap<OwnedEventId, PduEvent> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
pub(super) fn INITIAL_EDGES() -> Vec<OwnedEventId> {
|
||||
vec!["START", "IMC", "IMB", "IJR", "IPOWER", "IMA", "CREATE"]
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user