Skip to content

Commit 8c3eaac

Browse files
committed
reorder InstrumentationConfig::new args
1 parent 3f1eba9 commit 8c3eaac

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
@@ -43,18 +43,18 @@ impl ModuleMatcher {
4343

4444
#[derive(Debug, Clone)]
4545
pub struct InstrumentationConfig {
46+
pub channel_name: String,
4647
pub module: ModuleMatcher,
4748
pub function_query: FunctionQuery,
48-
pub channel_name: String,
4949
}
5050

5151
impl InstrumentationConfig {
5252
#[must_use]
53-
pub fn new(module: ModuleMatcher, function_query: FunctionQuery, channel_name: &str) -> Self {
53+
pub fn new(channel_name: &str, module: ModuleMatcher, function_query: FunctionQuery) -> Self {
5454
Self {
55+
channel_name: channel_name.to_string(),
5556
module,
5657
function_query,
57-
channel_name: channel_name.to_string(),
5858
}
5959
}
6060
}

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)