Remove remain alphabetical sorting enforcement macros (#1647)

remove `remain`

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
This commit is contained in:
Karthik Prakash
2024-03-06 16:43:51 +00:00
committed by GitHub
co-authored by 0HyperCube
parent a47fff905e
commit 0c60fd95fa
53 changed files with 21 additions and 292 deletions
@@ -3,7 +3,6 @@ use crate::messages::prelude::*;
use serde::{Deserialize, Serialize};
#[remain::sorted]
#[impl_message(Message, Layout)]
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum LayoutMessage {
@@ -271,10 +271,8 @@ impl LayoutMessageHandler {
}
impl<F: Fn(&MessageDiscriminant) -> Vec<KeysGroup>> MessageHandler<LayoutMessage, F> for LayoutMessageHandler {
#[remain::check]
fn process_message(&mut self, message: LayoutMessage, responses: &mut std::collections::VecDeque<Message>, action_input_mapping: F) {
use LayoutMessage::*;
#[remain::sorted]
match message {
ResendActiveWidget { layout_target, widget_id } => {
// Find the updated diff based on the specified layout target
@@ -345,13 +343,11 @@ impl LayoutMessageHandler {
}
/// Send a diff to the frontend based on the layout target.
#[remain::check]
fn send_diff(&self, mut diff: Vec<WidgetDiff>, layout_target: LayoutTarget, responses: &mut VecDeque<Message>, action_input_mapping: &impl Fn(&MessageDiscriminant) -> Vec<KeysGroup>) {
diff.iter_mut().for_each(|diff| diff.new_value.apply_keyboard_shortcut(action_input_mapping));
trace!("{layout_target:?} diff {diff:#?}");
#[remain::sorted]
let message = match layout_target {
LayoutTarget::DialogButtons => FrontendMessage::UpdateDialogButtons { layout_target, diff },
LayoutTarget::DialogColumn1 => FrontendMessage::UpdateDialogColumn1 { layout_target, diff },
@@ -367,7 +363,6 @@ impl LayoutMessageHandler {
LayoutTarget::ToolShelf => FrontendMessage::UpdateToolShelfLayout { layout_target, diff },
LayoutTarget::WorkingColors => FrontendMessage::UpdateWorkingColorsLayout { layout_target, diff },
#[remain::unsorted]
LayoutTarget::LayoutTargetLength => panic!("`LayoutTargetLength` is not a valid Layout Target and is used for array indexing"),
};
responses.add(message);
@@ -20,7 +20,6 @@ impl core::fmt::Display for WidgetId {
}
}
#[remain::sorted]
#[derive(PartialEq, Clone, Debug, Hash, Eq, Copy, Serialize, Deserialize, specta::Type)]
#[repr(u8)]
pub enum LayoutTarget {
@@ -53,7 +52,6 @@ pub enum LayoutTarget {
// KEEP THIS ENUM LAST
// This is a marker that is used to define an array that is used to hold widgets
#[remain::unsorted]
LayoutTargetLength,
}
@@ -292,7 +290,6 @@ impl<'a> Iterator for WidgetIterMut<'a> {
pub type SubLayout = Vec<LayoutGroup>;
#[remain::sorted]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, specta::Type)]
pub enum LayoutGroup {
#[serde(rename = "column")]
@@ -475,7 +472,6 @@ impl<T> Default for WidgetCallback<T> {
}
}
#[remain::sorted]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, specta::Type)]
pub enum Widget {
BreadcrumbTrailButtons(BreadcrumbTrailButtons),