Skip to content

Commit 42e2c1d

Browse files
committed
refactor(linter): remove Rc from DisableDirectives (#13924)
1 parent bd2fa90 commit 42e2c1d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/oxc_linter/src/context/host.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct ContextSubHost<'a> {
3232
pub(super) module_record: Arc<ModuleRecord>,
3333
/// Information about specific rules that should be disabled or enabled, via comment directives like
3434
/// `eslint-disable` or `eslint-disable-next-line`.
35-
pub(super) disable_directives: Rc<DisableDirectives<'a>>,
35+
pub(super) disable_directives: DisableDirectives<'a>,
3636
// Specific framework options, for example, whether the context is inside `<script setup>` in Vue files.
3737
pub(super) framework_options: FrameworkOptions,
3838
/// The source text offset of the sub host
@@ -75,7 +75,7 @@ impl<'a> ContextSubHost<'a> {
7575
semantic,
7676
module_record,
7777
source_text_offset,
78-
disable_directives: Rc::new(disable_directives),
78+
disable_directives,
7979
framework_options: frameworks_options,
8080
}
8181
}
@@ -93,7 +93,7 @@ impl<'a> ContextSubHost<'a> {
9393
}
9494

9595
/// Shared reference to the [`DisableDirectives`]
96-
pub fn disable_directives(&self) -> &Rc<DisableDirectives<'a>> {
96+
pub fn disable_directives(&self) -> &DisableDirectives<'a> {
9797
&self.disable_directives
9898
}
9999
}
@@ -202,7 +202,7 @@ impl<'a> ContextHost<'a> {
202202
}
203203

204204
/// Shared reference to the [`DisableDirectives`] of the current script block.
205-
pub fn disable_directives(&self) -> &Rc<DisableDirectives<'a>> {
205+
pub fn disable_directives(&self) -> &DisableDirectives<'a> {
206206
&self.current_sub_host().disable_directives
207207
}
208208

crates/oxc_linter/src/context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'a> LintContext<'a> {
125125

126126
/// List of all disable directives in the file being linted.
127127
#[inline]
128-
pub fn disable_directives(&self) -> &Rc<DisableDirectives<'a>> {
128+
pub fn disable_directives(&self) -> &DisableDirectives<'a> {
129129
self.parent.disable_directives()
130130
}
131131

0 commit comments

Comments
 (0)