common: Make all pub structs non_exhaustive

This commit is contained in:
Devin Ragotzy 2021-06-18 04:00:35 -07:00 committed by GitHub
parent 5a7e2cddcf
commit 626b5a5d06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 0 deletions

View File

@ -66,6 +66,7 @@ pub struct PublicRoomsChunk {
/// This struct will not be updated even if additional fields are added to `PublicRoomsChunk` in a
/// new (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct PublicRoomsChunkInit {
/// The number of members joined to the room.
pub num_joined_members: UInt,

View File

@ -152,6 +152,7 @@ pub struct SimplePushRule {
/// This struct will not be updated even if additional fields are added to `SimplePushRule` in a new
/// (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct SimplePushRuleInit {
/// Actions to determine if and how a notification is delivered for events matching this rule.
pub actions: Vec<Action>,
@ -241,6 +242,7 @@ impl ConditionalPushRule {
/// This struct will not be updated even if additional fields are added to `ConditionalPushRule` in
/// a new (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct ConditionalPushRuleInit {
/// Actions to determine if and how a notification is delivered for events matching this rule.
pub actions: Vec<Action>,
@ -338,6 +340,7 @@ impl PatternedPushRule {
/// This struct will not be updated even if additional fields are added to `PatterenedPushRule` in a
/// new (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct PatternedPushRuleInit {
/// Actions to determine if and how a notification is delivered for events matching this rule.
pub actions: Vec<Action>,

View File

@ -113,6 +113,7 @@ impl PushCondition {
/// The context of the room associated to an event to be able to test all push conditions.
#[derive(Clone, Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct PushConditionRoomCtx {
/// The ID of the room.
pub room_id: RoomId,

View File

@ -61,6 +61,7 @@ impl Default for ComparisonOperator {
/// let greater = RoomMemberCountIs::gt(uint!(3));
/// ```
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[allow(clippy::exhaustive_structs)]
pub struct RoomMemberCountIs {
/// One of `==`, `<`, `>`, `>=`, `<=`, or no prefix.
pub prefix: ComparisonOperator,

View File

@ -42,6 +42,7 @@ pub struct Protocol {
/// This struct will not be updated even if additional fields are added to `Prococol` in a new
/// (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct ProtocolInit {
/// Fields which may be used to identify a third party user.
pub user_fields: Vec<String>,
@ -96,6 +97,7 @@ pub struct ProtocolInstance {
/// This struct will not be updated even if additional fields are added to `Prococol` in a new
/// (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct ProtocolInstanceInit {
/// A human-readable description for the protocol, such as the name.
pub desc: String,
@ -150,6 +152,7 @@ pub struct FieldType {
/// This struct will not be updated even if additional fields are added to `FieldType` in a new
/// (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct FieldTypeInit {
/// A regular expression for validation of a field's value.
pub regexp: String,
@ -188,6 +191,7 @@ impl Location {
/// A third party network user.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct User {
/// A matrix user ID representing a third party user.
pub userid: UserId,
@ -246,6 +250,7 @@ pub struct ThirdPartyIdentifier {
/// This struct will not be updated even if additional fields are added to `ThirdPartyIdentifier`
/// in a new (non-breaking) release of the Matrix specification.
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct ThirdPartyIdentifierInit {
/// The third party identifier address.
pub address: String,

View File

@ -7,6 +7,7 @@ use std::{
/// A timestamp represented as the number of milliseconds since the unix epoch.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
#[allow(clippy::exhaustive_structs)]
#[serde(transparent)]
pub struct MilliSecondsSinceUnixEpoch(pub UInt);
@ -42,6 +43,7 @@ impl MilliSecondsSinceUnixEpoch {
/// A timestamp represented as the number of seconds since the unix epoch.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
#[allow(clippy::exhaustive_structs)]
#[serde(transparent)]
pub struct SecondsSinceUnixEpoch(pub UInt);