Replace panic!() with unreachable!()

This commit is contained in:
Matthias Ahouansou 2024-04-12 05:14:39 +00:00 committed by Val Lorentz
parent b5e21f761b
commit ab8592526f
3 changed files with 3 additions and 3 deletions

View file

@ -978,7 +978,7 @@ impl Service {
| RoomVersionId::V9
| RoomVersionId::V10 => RoomCreateEventContent::new_v1(conduit_user.clone()),
RoomVersionId::V11 => RoomCreateEventContent::new_v11(),
_ => panic!("Unexpected room version {}", room_version),
_ => unreachable!("Validity of room version already checked"),
};
content.federate = true;
content.predecessor = None;

View file

@ -178,13 +178,13 @@ impl Service {
RoomVersionId::V8,
RoomVersionId::V9,
RoomVersionId::V10,
RoomVersionId::V11,
];
// Experimental, partially supported room versions
let unstable_room_versions = vec![
RoomVersionId::V3,
RoomVersionId::V4,
RoomVersionId::V5,
RoomVersionId::V11,
];
let mut s = Self {

View file

@ -407,7 +407,7 @@ impl Service {
self.redact_pdu(redact_id, pdu)?;
}
}
_ => panic!("Unexpected room version {}", room_version_id)
_ => unreachable!("Validity of room version already checked")
};
}
TimelineEventType::SpaceChild => {