summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poveda <christian.poveda@ferrous-systems.com>2022-09-26 11:02:42 -0500
committerChristian Poveda <christian.poveda@ferrous-systems.com>2022-09-26 11:02:42 -0500
commit06a6479e9e6fe9b556a54b3d7f28c23b1268b048 (patch)
treebdf43c6b03035044f6c8e6812db762f0e38643eb
parent4312df317a2fdf26ec889cb2f8d3ffe0b12ea4d3 (diff)
s/static/const
-rw-r--r--src/codegen/postprocessing.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/codegen/postprocessing.rs b/src/codegen/postprocessing.rs
index 6d935a61..6550ca57 100644
--- a/src/codegen/postprocessing.rs
+++ b/src/codegen/postprocessing.rs
@@ -20,8 +20,8 @@ macro_rules! pass {
};
}
-static PASSES: [PostProcessingPass; 2] =
- [pass!(merge_extern_blocks), pass!(sort_semantically)];
+const PASSES: &'static [PostProcessingPass] =
+ &[pass!(merge_extern_blocks), pass!(sort_semantically)];
pub(crate) fn postprocessing(
items: Vec<TokenStream>,
@@ -43,13 +43,12 @@ pub(crate) fn postprocessing(
// The first one won't panic because we build the `mod` and know it is there
// The second one won't panic because we know original output has something in
// it already.
- let mut items = syn::parse2::<syn::ItemMod>(module_wrapped_tokens)
+ let (_, mut items) = syn::parse2::<syn::ItemMod>(module_wrapped_tokens)
.unwrap()
.content
- .unwrap()
- .1;
+ .unwrap();
- for pass in PASSES.iter() {
+ for pass in PASSES {
if (pass.should_run)(options) {
(pass.run)(&mut items);
}