Skip to content

Commit

Permalink
fix: clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed May 10, 2024
1 parent c59a2a2 commit 18c9f9a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/oxc_linter/src/rules/react/rules_of_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ impl Rule for RulesOfHooks {

// TODO: all `dijkstra` algorithms can be merged together for better performance.
impl RulesOfHooks {
#![allow(clippy::unused_self, clippy::inline_always)]
#[inline(always)]
fn is_cyclic<'a>(&self, ctx: &LintContext<'a>, node_cfg_ix: NodeIndex) -> bool {
fn is_cyclic(&self, ctx: &LintContext, node_cfg_ix: NodeIndex) -> bool {
let graph = &ctx.semantic().cfg().graph;
petgraph::algo::dijkstra(graph, node_cfg_ix, None, |_| 0)
.into_keys()
Expand All @@ -228,9 +229,9 @@ impl RulesOfHooks {
}

#[inline(always)]
fn is_conditional<'a>(
fn is_conditional(
&self,
ctx: &LintContext<'a>,
ctx: &LintContext,
func_cfg_ix: NodeIndex,
node_cfg_ix: NodeIndex,
) -> bool {
Expand All @@ -242,9 +243,9 @@ impl RulesOfHooks {
}

#[inline(always)]
fn breaks_early<'a>(
fn breaks_early(
&self,
ctx: &LintContext<'a>,
ctx: &LintContext,
func_cfg_ix: NodeIndex,
node_cfg_ix: NodeIndex,
) -> bool {
Expand Down

0 comments on commit 18c9f9a

Please sign in to comment.