Skip to content

Commit ad8e266

Browse files
committed
chore: fixed linting and formatting issues
1 parent 2518fcb commit ad8e266

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/instrumentation.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use std::path::PathBuf;
77
use swc_core::common::{Span, SyntaxContext};
88
use swc_core::ecma::{
99
ast::{
10-
ArrowExpr, AssignExpr, AssignTarget, BlockStmt, ClassDecl, ClassExpr, ClassMethod, Constructor, Expr,
11-
FnDecl, FnExpr, Ident, Lit, MemberProp, MethodProp, Module, ModuleItem, Pat, PropName,
12-
Script, SimpleAssignTarget, Stmt, Str, VarDecl,
10+
ArrowExpr, AssignExpr, AssignTarget, BlockStmt, ClassDecl, ClassExpr, ClassMethod,
11+
Constructor, Expr, FnDecl, FnExpr, Ident, Lit, MemberProp, MethodProp, Module, ModuleItem,
12+
Pat, PropName, Script, SimpleAssignTarget, Stmt, Str, VarDecl,
1313
},
1414
atoms::Atom,
1515
};
@@ -236,17 +236,13 @@ impl Instrumentation {
236236
.is_none_or(|class| node.ident.sym.as_ref() == class);
237237
true
238238
}
239-
239+
240240
pub fn visit_mut_class_expr(&mut self, node: &mut ClassExpr) -> bool {
241-
self.is_correct_class = self
242-
.config
243-
.function_query
244-
.class_name()
245-
.is_none_or(|class| {
241+
self.is_correct_class = self.config.function_query.class_name().is_none_or(|class| {
246242
node.ident
247243
.as_ref()
248-
.map_or(false, |ident| ident.sym.as_ref() == class)
249-
});
244+
.is_some_and(|ident| ident.sym.as_ref() == class)
245+
});
250246
true
251247
}
252248

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use swc_core::{
2727
common::{comments::Comments, errors::ColorConfig, FileName, FilePathMapping},
2828
ecma::{
2929
ast::{
30-
AssignExpr, ClassDecl, ClassMethod, ClassExpr, Constructor, EsVersion, FnDecl, MethodProp, Module,
31-
Script, Str, VarDecl,
30+
AssignExpr, ClassDecl, ClassExpr, ClassMethod, Constructor, EsVersion, FnDecl,
31+
MethodProp, Module, Script, Str, VarDecl,
3232
},
3333
visit::{VisitMut, VisitMutWith},
3434
},

0 commit comments

Comments
 (0)