-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Unify Message variants
#18051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify Message variants
#18051
Changes from all commits
d1e0454
decf14a
b0ee111
035adcb
3ff0881
2253f6a
a10354b
846d5fa
389bebb
d264bc2
7bece41
a6ec451
ae0b0ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ use crate::registry::{AsRule, Linter}; | |
| use crate::rule_selector::is_single_rule_selector; | ||
| use crate::rules; | ||
|
|
||
| #[derive(PartialEq, Eq, PartialOrd, Ord)] | ||
| #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] | ||
| pub struct NoqaCode(&'static str, &'static str); | ||
|
Comment on lines
+13
to
14
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More an idea for a separate PR if you're interested in it. I wonder if we should store the code as a single Thinking about this more. It's probably not even necessary to store the offset and we can simply compute the split point on demand.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added these three ( |
||
|
|
||
| impl NoqaCode { | ||
|
|
@@ -46,6 +46,15 @@ impl PartialEq<&str> for NoqaCode { | |
| } | ||
| } | ||
|
|
||
| impl serde::Serialize for NoqaCode { | ||
| fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> | ||
| where | ||
| S: serde::Serializer, | ||
| { | ||
| serializer.serialize_str(&self.to_string()) | ||
| } | ||
| } | ||
|
|
||
| #[derive(Debug, Copy, Clone)] | ||
| pub enum RuleGroup { | ||
| /// The rule is stable. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change didn't actually end up helping at all (besides
Nonebeing slightly shorter thanTextSize::default()), so I'm happy to revert it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably even increases the size of the struct but I think it's more correct overall.