Skip to content

Commit e09e5af

Browse files
committed
chore: cargo fmt
1 parent 96f3d8e commit e09e5af

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/function_query.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub(crate) enum FunctionType {
1010
FunctionDeclaration,
1111
FunctionExpression,
1212
Method,
13-
PrivateMethod
13+
PrivateMethod,
1414
}
1515

1616
/// The kind of function - Sync or returns a promise
@@ -201,7 +201,10 @@ impl FunctionQuery {
201201
FunctionQuery::ClassConstructor { .. } => "constructor",
202202
FunctionQuery::ClassMethod { method_name, .. }
203203
| FunctionQuery::ObjectMethod { method_name, .. } => method_name,
204-
FunctionQuery::PrivateMethod { private_method_name, .. } => private_method_name,
204+
FunctionQuery::PrivateMethod {
205+
private_method_name,
206+
..
207+
} => private_method_name,
205208
FunctionQuery::FunctionDeclaration { function_name, .. } => function_name,
206209
FunctionQuery::FunctionExpression {
207210
expression_name, ..
@@ -306,7 +309,7 @@ impl FunctionQuery {
306309
matches!(self.typ(), FunctionType::Method) && name == self.name();
307310
self.maybe_increment_count(matches_except_count, count)
308311
}
309-
312+
310313
pub fn matches_private_method(&self, count: &mut usize, name: &str) -> bool {
311314
let matches_except_count =
312315
matches!(self.typ(), FunctionType::PrivateMethod) && name == self.name();

src/instrumentation.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use swc_core::ecma::{
1010
ast::{
1111
ArrowExpr, AssignExpr, AssignTarget, BlockStmt, ClassDecl, ClassExpr, ClassMethod,
1212
Constructor, Expr, FnDecl, FnExpr, Ident, Lit, MemberProp, MethodProp, Module, ModuleItem,
13-
Param, Pat, PropName, PrivateMethod, Script, SimpleAssignTarget, Stmt, Str, VarDecl,
13+
Param, Pat, PrivateMethod, PropName, Script, SimpleAssignTarget, Stmt, Str, VarDecl,
1414
},
1515
atoms::Atom,
1616
};
@@ -310,7 +310,7 @@ impl Instrumentation {
310310
});
311311
true
312312
}
313-
313+
314314
pub fn visit_mut_class_method(&mut self, node: &mut ClassMethod) -> bool {
315315
let name = match &node.key {
316316
PropName::Ident(ident) => ident.sym.clone(),
@@ -334,7 +334,7 @@ impl Instrumentation {
334334
}
335335
true
336336
}
337-
337+
338338
pub fn visit_mut_private_method(&mut self, node: &mut PrivateMethod) -> bool {
339339
let name = node.key.name.clone();
340340

@@ -356,7 +356,6 @@ impl Instrumentation {
356356
true
357357
}
358358

359-
360359
pub fn visit_mut_constructor(&mut self, node: &mut Constructor) -> bool {
361360
if !self.is_correct_class || self.config.function_query.name() != "constructor" {
362361
return false;

0 commit comments

Comments
 (0)