Skip to main content

EarlyReturns

Trait EarlyReturns 

Source
pub trait EarlyReturns {
    // Required method
    fn can_skip(&self, content: &str) -> bool;

    // Provided method
    fn early_return_if_skippable(&self, content: &str) -> Option<LintResult> { ... }
}
Expand description

Trait for implementing early returns in rules

Required Methods§

Source

fn can_skip(&self, content: &str) -> bool

Check if this rule can be skipped based on content analysis

Provided Methods§

Source

fn early_return_if_skippable(&self, content: &str) -> Option<LintResult>

Returns the empty result if the rule can be skipped

Implementors§