atagen

macltok

public
Star0
Watch0

Commit 8b67d612ef83

tarball

atagen <boss@atagen.co>2026-10-24 10:11 UTC

4 files changed+0-34
model: let consumers match output enums exhaustively

non_exhaustive on enums macltok hands out forced a wildcard arm downstream, so a new Event or ErrorKind variant compiled quietly into a fallback instead of telling malice what to handle. Malice is the only consumer and pins by rev, so a compile error is the cheaper signal before release. Enums consumers only build, like the commands, and every struct keep it.
Modified file: src/error.rs−1 deletions
@@ -42,7 +42,6 @@ pub struct Error {
4242
4343 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4444 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
45-#[non_exhaustive]
4645 pub enum ErrorKind {
4746 /// the engine stopped, or the task doing the work died, before answering
4847 Interrupted,
Modified file: src/mirror.rs−3 deletions
@@ -88,7 +88,6 @@ pub struct UploadFailure {
8888 /// the `Termination` it'll end in, as far as the events tell
8989 #[derive(Clone, Debug, Eq, PartialEq)]
9090 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
91-#[non_exhaustive]
9291 pub enum SessionStatus {
9392 Active,
9493 SoftLoggedOut {
@@ -109,7 +108,6 @@ pub struct Update {
109108 }
110109
111110 #[derive(Clone, Debug)]
112-#[non_exhaustive]
113111 pub enum StateChange {
114112 /// start over from this. a subscription opens with one and gets another after lagging
115113 State(Arc<State>),
@@ -149,7 +147,6 @@ pub enum StateChange {
149147 }
150148
151149 #[derive(Clone, Debug)]
152-#[non_exhaustive]
153150 pub enum TimelineChange {
154151 Reset {
155152 items: Vector<TimelineItem>,
Modified file: src/model.rs−29 deletions
@@ -326,7 +326,6 @@ impl TimelineCommand {
326326
327327 #[derive(Clone, Debug, Eq, Hash, PartialEq)]
328328 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
329-#[non_exhaustive]
330329 pub enum TimelineId {
331330 Room(OwnedRoomId),
332331 Thread {
@@ -632,7 +631,6 @@ pub enum LifecycleCommand {
632631
633632 #[derive(Clone, Debug, Eq, PartialEq)]
634633 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
635-#[non_exhaustive]
636634 pub enum CommandOutput {
637635 Done,
638636 Room(OwnedRoomId),
@@ -812,7 +810,6 @@ impl MessageMentions {
812810
813811 #[derive(Clone, Debug, Eq, PartialEq)]
814812 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
815-#[non_exhaustive]
816813 pub enum Event {
817814 ConnectionChanged(ConnectionState),
818815 Authenticated {
@@ -892,7 +889,6 @@ pub enum Event {
892889
893890 #[derive(Clone, Debug, Eq, PartialEq)]
894891 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
895-#[non_exhaustive]
896892 pub enum UploadOutcome {
897893 Sent {
898894 event_id: OwnedEventId,
@@ -907,7 +903,6 @@ pub enum UploadOutcome {
907903 /// why `Engine::run` came back, when nothing went wrong
908904 #[derive(Clone, Debug, Eq, PartialEq)]
909905 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
910-#[non_exhaustive]
911906 pub enum Termination {
912907 ShutDown,
913908 /// every `ClientHandle` was dropped, so nobody could have asked for anything else
@@ -944,7 +939,6 @@ pub enum Retain {
944939
945940 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
946941 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
947-#[non_exhaustive]
948942 pub enum ConnectionState {
949943 Idle,
950944 Connecting,
@@ -1049,7 +1043,6 @@ pub struct SpaceChild {
10491043
10501044 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10511045 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1052-#[non_exhaustive]
10531046 pub enum RoomNotificationMode {
10541047 AllMessages,
10551048 MentionsAndKeywordsOnly,
@@ -1066,7 +1059,6 @@ pub struct RoomNotificationSettings {
10661059
10671060 #[derive(Clone, Debug)]
10681061 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1069-#[non_exhaustive]
10701062 pub enum PushNotificationStatus {
10711063 Event(Box<PushNotification>),
10721064 NotFound,
@@ -1116,7 +1108,6 @@ pub struct PushNotificationRoom {
11161108
11171109 #[derive(Clone, Debug)]
11181110 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1119-#[non_exhaustive]
11201111 pub enum PushNotificationEvent {
11211112 Timeline(Raw<AnySyncTimelineEvent>),
11221113 Invite(Raw<StrippedRoomMemberEvent>),
@@ -1162,7 +1153,6 @@ pub struct PowerLevelChanges {
11621153
11631154 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11641155 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1165-#[non_exhaustive]
11661156 pub enum RoomMembership {
11671157 Joined,
11681158 Invited,
@@ -1280,7 +1270,6 @@ pub enum MemberFilter {
12801270
12811271 #[derive(Clone, Debug, Eq, PartialEq)]
12821272 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1283-#[non_exhaustive]
12841273 pub enum MemberMembership {
12851274 Joined,
12861275 Invited,
@@ -1318,7 +1307,6 @@ pub struct OwnDevice {
13181307
13191308 #[derive(Clone, Debug, Eq, PartialEq)]
13201309 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1321-#[non_exhaustive]
13221310 pub enum TimelineItem {
13231311 Event(Box<TimelineEvent>),
13241312 DayDivider { timestamp_ms: u64 },
@@ -1328,7 +1316,6 @@ pub enum TimelineItem {
13281316
13291317 #[derive(Clone, Debug, Eq, PartialEq)]
13301318 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1331-#[non_exhaustive]
13321319 pub enum TimelineDiff {
13331320 Append { values: Vec<TimelineItem> },
13341321 Clear,
@@ -1628,7 +1615,6 @@ impl Sender {
16281615
16291616 #[derive(Clone, Debug, Eq, PartialEq)]
16301617 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1631-#[non_exhaustive]
16321618 pub enum TimelineContent {
16331619 Message(Message),
16341620 Sticker {
@@ -1714,7 +1700,6 @@ pub struct LinkPreviewImage {
17141700
17151701 #[derive(Clone, Debug, Eq, PartialEq)]
17161702 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1717-#[non_exhaustive]
17181703 pub enum MessageKind {
17191704 Text,
17201705 Emote,
@@ -1731,7 +1716,6 @@ pub enum MessageKind {
17311716
17321717 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
17331718 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1734-#[non_exhaustive]
17351719 pub enum MembershipChange {
17361720 Joined,
17371721 Left,
@@ -1761,7 +1745,6 @@ pub struct Change<T> {
17611745 /// why a message couldn't be read, worth telling the user since some of these they can fix
17621746 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
17631747 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1764-#[non_exhaustive]
17651748 pub enum UtdCause {
17661749 Unknown,
17671750 SentBeforeWeJoined,
@@ -1785,7 +1768,6 @@ pub struct ThreadSummary {
17851768
17861769 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
17871770 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1788-#[non_exhaustive]
17891771 pub enum SendState {
17901772 Sent,
17911773 Sending,
@@ -1807,7 +1789,6 @@ pub struct ReplyReference {
18071789 /// the replied-to event. macltok asks for it when it isn't loaded, `Pending` then turns into one of the others
18081790 #[derive(Clone, Debug, Eq, PartialEq)]
18091791 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1810-#[non_exhaustive]
18111792 pub enum ReplyDetails {
18121793 Pending,
18131794 Ready {
@@ -1881,7 +1862,6 @@ pub struct ImagePack {
18811862
18821863 #[derive(Clone, Debug, Eq, PartialEq)]
18831864 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1884-#[non_exhaustive]
18851865 pub enum ImagePackSource {
18861866 User,
18871867 Room {
@@ -1908,7 +1888,6 @@ pub struct PackImage {
19081888
19091889 #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19101890 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1911-#[non_exhaustive]
19121891 pub enum PackUsage {
19131892 Emoticon,
19141893 Sticker,
@@ -2001,7 +1980,6 @@ pub struct Media {
20011980 /// where media lives, for a host that fetches and decrypts it itself
20021981 #[derive(Clone, Debug, Eq, PartialEq)]
20031982 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2004-#[non_exhaustive]
20051983 pub enum MediaLocation {
20061984 File(MediaFile),
20071985 /// a resize of plaintext, so never encrypted. plenty of servers refuse some, and `media`
@@ -2039,7 +2017,6 @@ pub struct AttachmentEncryption {
20392017
20402018 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
20412019 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2042-#[non_exhaustive]
20432020 pub enum MediaKind {
20442021 Image,
20452022 Video,
@@ -2058,7 +2035,6 @@ pub struct TypingState {
20582035
20592036 #[derive(Clone, Debug, Eq, PartialEq)]
20602037 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2061-#[non_exhaustive]
20622038 pub enum HistoryState {
20632039 Idle,
20642040 Loading,
@@ -2078,7 +2054,6 @@ pub struct EncryptionState {
20782054
20792055 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
20802056 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2081-#[non_exhaustive]
20822057 pub enum KeyBackupState {
20832058 Unknown,
20842059 Creating,
@@ -2091,7 +2066,6 @@ pub enum KeyBackupState {
20912066
20922067 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
20932068 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2094-#[non_exhaustive]
20952069 pub enum RecoveryState {
20962070 Unknown,
20972071 Disabled,
@@ -2124,7 +2098,6 @@ pub enum VerificationTarget {
21242098
21252099 #[derive(Clone, Debug, Eq, PartialEq)]
21262100 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2127-#[non_exhaustive]
21282101 pub enum VerificationState {
21292102 Waiting,
21302103 /// someone else asked. `Accept` to go ahead, `Cancel` to turn them down
@@ -2144,7 +2117,6 @@ pub enum VerificationState {
21442117
21452118 #[derive(Clone, Debug, Eq, PartialEq)]
21462119 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2147-#[non_exhaustive]
21482120 pub enum VerificationFailure {
21492121 RequestAcceptance(String),
21502122 SasStartup(String),
@@ -2163,7 +2135,6 @@ pub struct EngineFailure {
21632135
21642136 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
21652137 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2166-#[non_exhaustive]
21672138 pub enum EngineErrorKind {
21682139 EventReceiverClosed,
21692140 Watcher,
Modified file: src/uiaa.rs−1 deletions
@@ -227,7 +227,6 @@ pub struct InteractiveAuthFailure {
227227
228228 #[derive(Clone, Debug, Eq, PartialEq)]
229229 #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
230-#[non_exhaustive]
231230 pub enum InteractiveAuthOutcome {
232231 Completed,
233232 Challenge(InteractiveAuthChallenge),