events: Make IgnoredUserListEventContent non-exhaustive
This commit is contained in:
parent
914279010a
commit
5b0c675cb8
@ -11,6 +11,7 @@ pub type IgnoredUserListEvent = BasicEvent<IgnoredUserListEventContent>;
|
||||
|
||||
/// The payload for `IgnoredUserListEvent`.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, BasicEventContent)]
|
||||
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||
#[ruma_event(type = "m.ignored_user_list")]
|
||||
pub struct IgnoredUserListEventContent {
|
||||
/// A list of users to ignore.
|
||||
@ -18,6 +19,13 @@ pub struct IgnoredUserListEventContent {
|
||||
pub ignored_users: Vec<UserId>,
|
||||
}
|
||||
|
||||
impl IgnoredUserListEventContent {
|
||||
/// Creates a new `IgnoredUserListEventContent` from the given user IDs.
|
||||
pub fn new(ignored_users: Vec<UserId>) -> Self {
|
||||
Self { ignored_users }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use matches::assert_matches;
|
||||
|
Loading…
x
Reference in New Issue
Block a user