Skip to content

Commit 06a6479

Browse files
committed
s/static/const
1 parent 4312df3 commit 06a6479

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/codegen/postprocessing.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ macro_rules! pass {
2020
};
2121
}
2222

23-
static PASSES: [PostProcessingPass; 2] =
24-
[pass!(merge_extern_blocks), pass!(sort_semantically)];
23+
const PASSES: &'static [PostProcessingPass] =
24+
&[pass!(merge_extern_blocks), pass!(sort_semantically)];
2525

2626
pub(crate) fn postprocessing(
2727
items: Vec<TokenStream>,
@@ -43,13 +43,12 @@ pub(crate) fn postprocessing(
4343
// The first one won't panic because we build the `mod` and know it is there
4444
// The second one won't panic because we know original output has something in
4545
// it already.
46-
let mut items = syn::parse2::<syn::ItemMod>(module_wrapped_tokens)
46+
let (_, mut items) = syn::parse2::<syn::ItemMod>(module_wrapped_tokens)
4747
.unwrap()
4848
.content
49-
.unwrap()
50-
.1;
49+
.unwrap();
5150

52-
for pass in PASSES.iter() {
51+
for pass in PASSES {
5352
if (pass.should_run)(options) {
5453
(pass.run)(&mut items);
5554
}

0 commit comments

Comments
 (0)