Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove whitespaces added by macros due to token re-parsing
  • Loading branch information
karolk91 committed Jul 28, 2025
commit 01812ccfc62b970768e88312c72ecae96eba19ec
20 changes: 10 additions & 10 deletions substrate/frame/benchmarking/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1818,8 +1818,8 @@ pub fn show_benchmark_debug_info(
#[macro_export]
macro_rules! add_benchmark {
( $params:ident, $batches:ident, $name:path, $location:ty ) => {
let name_string = stringify!($name).as_bytes();
let instance_string = stringify!($location).as_bytes();
let pallet_string = stringify!($name).replace(" ", "").into_bytes();
let instance_string = stringify!($location).replace(" ", "").into_bytes();
let (config, whitelist) = $params;
let $crate::BenchmarkConfig {
pallet,
Expand All @@ -1829,7 +1829,7 @@ macro_rules! add_benchmark {
verify,
internal_repeats,
} = config;
if &pallet[..] == &name_string[..] && &instance[..] == &instance_string[..] {
if &pallet[..] == &pallet_string[..] && &instance[..] == &instance_string[..] {
let benchmark_result = <$location as $crate::Benchmarking>::run_benchmark(
&benchmark[..],
&selected_components[..],
Expand All @@ -1852,7 +1852,7 @@ macro_rules! add_benchmark {
},
Err($crate::BenchmarkError::Stop(e)) => {
$crate::show_benchmark_debug_info(
instance_string,
&instance_string,
benchmark,
selected_components,
verify,
Expand Down Expand Up @@ -1883,8 +1883,8 @@ macro_rules! add_benchmark {

if let Some(final_results) = final_results {
$batches.push($crate::BenchmarkBatch {
pallet: name_string.to_vec(),
instance: instance_string.to_vec(),
pallet: pallet_string,
instance: instance_string,
benchmark: benchmark.clone(),
results: final_results,
});
Expand Down Expand Up @@ -1915,12 +1915,12 @@ macro_rules! add_benchmark {
#[macro_export]
macro_rules! list_benchmark {
( $list:ident, $extra:ident, $name:path, $location:ty ) => {
let pallet_string = stringify!($name).as_bytes();
let instance_string = stringify!($location).as_bytes();
let pallet_string = stringify!($name).replace(" ", "").into_bytes();
let instance_string = stringify!($location).replace(" ", "").into_bytes();
let benchmarks = <$location as $crate::Benchmarking>::benchmarks($extra);
let pallet_benchmarks = $crate::BenchmarkList {
pallet: pallet_string.to_vec(),
instance: instance_string.to_vec(),
pallet: pallet_string,
instance: instance_string,
benchmarks: benchmarks.to_vec(),
};
$list.push(pallet_benchmarks)
Expand Down
Loading