pub struct RuleST02;Expand description
ST02: Unnecessary CASE expression.
Detects two patterns:
- Boolean wrapping: CASE WHEN cond THEN TRUE ELSE FALSE END → use cond directly
- IS NULL fallback: CASE WHEN x IS NULL THEN y ELSE x END → use COALESCE(x, y)
Trait Implementations§
Source§impl Rule for RuleST02
impl Rule for RuleST02
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
One-line description.
Source§fn explanation(&self) -> &'static str
fn explanation(&self) -> &'static str
Multi-sentence explanation for AI consumers.
Source§fn is_fixable(&self) -> bool
fn is_fixable(&self) -> bool
Can this rule auto-fix violations?
Source§fn crawl_type(&self) -> CrawlType
fn crawl_type(&self) -> CrawlType
Which segments should be visited.
Source§fn eval(&self, ctx: &RuleContext<'_>) -> Vec<LintViolation>
fn eval(&self, ctx: &RuleContext<'_>) -> Vec<LintViolation>
Evaluate the rule at the given context, returning violations.
Auto Trait Implementations§
impl Freeze for RuleST02
impl RefUnwindSafe for RuleST02
impl Send for RuleST02
impl Sync for RuleST02
impl Unpin for RuleST02
impl UnsafeUnpin for RuleST02
impl UnwindSafe for RuleST02
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more