Skip to content

Commit 19b4ae3

Browse files
committed
Merge branch 'feat/combine-config-enums' into feat/wasm
2 parents 64f80d4 + 8c3eaac commit 19b4ae3

14 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ impl ModuleMatcher {
4949
#[cfg_attr(feature = "wasm", tsify(into_wasm_abi, from_wasm_abi))]
5050
#[serde(rename_all = "camelCase")]
5151
pub struct InstrumentationConfig {
52+
pub channel_name: String,
5253
pub module: ModuleMatcher,
5354
pub function_query: FunctionQuery,
54-
pub channel_name: String,
5555
}
5656

5757
impl InstrumentationConfig {
5858
#[must_use]
59-
pub fn new(module: ModuleMatcher, function_query: FunctionQuery, channel_name: &str) -> Self {
59+
pub fn new(channel_name: &str, module: ModuleMatcher, function_query: FunctionQuery) -> Self {
6060
Self {
61+
channel_name: channel_name.to_string(),
6162
module,
6263
function_query,
63-
channel_name: channel_name.to_string(),
6464
}
6565
}
6666
}

tests/class_method_cjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fn class_method_cjs() {
77
file!(),
88
false,
99
Config::new_single(InstrumentationConfig::new(
10+
"Undici_fetch",
1011
test_module_matcher(),
1112
FunctionQuery::class_method("Undici", "fetch", FunctionKind::Async),
12-
"Undici_fetch",
1313
)),
1414
);
1515
}

tests/constructor_cjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fn constructor_cjs() {
77
file!(),
88
false,
99
Config::new_single(InstrumentationConfig::new(
10+
"Undici_constructor",
1011
test_module_matcher(),
1112
FunctionQuery::class_constructor("Undici"),
12-
"Undici_constructor",
1313
)),
1414
);
1515
}

tests/constructor_mjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fn constructor_mjs() {
77
file!(),
88
true,
99
Config::new_single(InstrumentationConfig::new(
10+
"Undici_constructor",
1011
test_module_matcher(),
1112
FunctionQuery::class_constructor("Undici"),
12-
"Undici_constructor",
1313
)),
1414
);
1515
}

tests/decl_cjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fn decl_cjs() {
77
file!(),
88
false,
99
Config::new_single(InstrumentationConfig::new(
10+
"fetch_decl",
1011
test_module_matcher(),
1112
FunctionQuery::function_declaration("fetch", FunctionKind::Async),
12-
"fetch_decl",
1313
)),
1414
);
1515
}

tests/decl_mjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fn decl_mjs() {
77
file!(),
88
true,
99
Config::new_single(InstrumentationConfig::new(
10+
"fetch_decl",
1011
test_module_matcher(),
1112
FunctionQuery::function_declaration("fetch", FunctionKind::Async),
12-
"fetch_decl",
1313
)),
1414
);
1515
}

tests/expr_cjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fn expr_cjs() {
77
file!(),
88
false,
99
Config::new_single(InstrumentationConfig::new(
10+
"fetch_expr",
1011
test_module_matcher(),
1112
FunctionQuery::function_expression("fetch", FunctionKind::Async),
12-
"fetch_expr",
1313
)),
1414
);
1515
}

tests/expr_mjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fn expr_mjs() {
77
file!(),
88
true,
99
Config::new_single(InstrumentationConfig::new(
10+
"fetch_expr",
1011
test_module_matcher(),
1112
FunctionQuery::function_expression("fetch", FunctionKind::Async),
12-
"fetch_expr",
1313
)),
1414
);
1515
}

tests/index_cjs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ fn index_cjs() {
77
file!(),
88
false,
99
Config::new_single(InstrumentationConfig::new(
10+
"Undici_fetch",
1011
test_module_matcher(),
1112
FunctionQuery::ClassMethod {
1213
class_name: "Undici".to_string(),
1314
method_name: "fetch".to_string(),
1415
kind: FunctionKind::Async,
1516
index: 2,
1617
},
17-
"Undici_fetch",
1818
)),
1919
);
2020
}

tests/multiple_class_method_cjs/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ fn multiple_class_method_cjs() {
99
Config::new(
1010
vec![
1111
InstrumentationConfig::new(
12+
"Undici_fetch1",
1213
test_module_matcher(),
1314
FunctionQuery::class_method("Undici", "fetch1", FunctionKind::Async),
14-
"Undici_fetch1",
1515
),
1616
InstrumentationConfig::new(
17+
"Undici_fetch2",
1718
test_module_matcher(),
1819
FunctionQuery::class_method("Undici", "fetch2", FunctionKind::Async),
19-
"Undici_fetch2",
2020
),
2121
],
2222
None,

0 commit comments

Comments
 (0)