diff --git a/assembly/src/assembler/mod.rs b/assembly/src/assembler/mod.rs index 1d18d4dcda..741e7bc483 100644 --- a/assembly/src/assembler/mod.rs +++ b/assembly/src/assembler/mod.rs @@ -8,7 +8,7 @@ use super::{ use alloc::collections::BTreeMap; use alloc::vec::Vec; use core::{borrow::Borrow, cell::RefCell}; -use vm_core::{utils::group_vector_elements, Decorator, DecoratorList}; +use vm_core::{Decorator, DecoratorList}; mod instruction; @@ -467,12 +467,13 @@ fn combine_blocks(mut blocks: Vec) -> CodeBlock { while blocks.len() > 1 { let last_block = if blocks.len() % 2 == 0 { None } else { blocks.pop() }; - let mut grouped_blocks = Vec::new(); - core::mem::swap(&mut blocks, &mut grouped_blocks); - let mut grouped_blocks = group_vector_elements::(grouped_blocks); - grouped_blocks.drain(0..).for_each(|pair| { - blocks.push(CodeBlock::new_join(pair)); - }); + let mut source_blocks = Vec::new(); + core::mem::swap(&mut blocks, &mut source_blocks); + + let mut source_block_iter = source_blocks.drain(0..); + while let (Some(left), Some(right)) = (source_block_iter.next(), source_block_iter.next()) { + blocks.push(CodeBlock::new_join([left, right])); + } if let Some(block) = last_block { blocks.push(block); diff --git a/stdlib/build.rs b/stdlib/build.rs index 75f780020a..69b9a6b58b 100644 --- a/stdlib/build.rs +++ b/stdlib/build.rs @@ -21,7 +21,6 @@ type ModuleMap = BTreeMap; /// Read and parse the contents from `./asm` into a `LibraryContents` struct, serializing it into /// `assets` folder under `std` namespace. -#[cfg(not(feature = "docs-rs"))] fn main() -> io::Result<()> { // re-build the `[OUT_DIR]/assets/std.masl` file iff something in the `./asm` directory // or its builder changed: