diff --git a/compiler/generator/rust/rust_code_container.cpp b/compiler/generator/rust/rust_code_container.cpp index cffdb1b845..90c44d3998 100644 --- a/compiler/generator/rust/rust_code_container.cpp +++ b/compiler/generator/rust/rust_code_container.cpp @@ -649,15 +649,18 @@ void RustCodeContainer::generateComputeFrame(int n) tab(n, *fOut); tab(n, *fOut); *fOut << "pub fn compute_frame(&mut self, inputs: &[&FaustFloat], "; - *fOut << "outputs: &mut [&mut FaustFloat]) {" << endl; + *fOut << "outputs: &mut [&mut FaustFloat]) {"; for(int i = 0; i < fNumInputs; i++){ + tab(n+1, *fOut); *fOut << "let input"<< i <<" = inputs["<< i <<"];"; }; for(int i = 0; i < fNumOutputs; i++){ - *fOut << "let (a, outputs): (&mut [&mut f64], &mut [&mut f64]) = outputs.split_at_mut(1);" << endl; - *fOut << "let output"<< i <<": &mut FaustFloat = a[0];" << endl; + tab(n+1, *fOut); + *fOut << "let (nextoutput, outputs): (&mut [&mut f64], &mut [&mut f64]) = outputs.split_at_mut(1);"; + tab(n+1, *fOut); + *fOut << "let output"<< i <<": &mut FaustFloat = nextoutput[0];"; }; fCodeProducer.Tab(n + 1); @@ -667,7 +670,9 @@ void RustCodeContainer::generateComputeFrame(int n) } else { } - *fOut << "//generateOneSample" << endl; + tab(n+1, *fOut); + *fOut << "//generateOneSample"; + tab(n+1, *fOut); // Generates one sample computation BlockInst* block = fCurLoop->generateOneSample(); block->accept(&fCodeProducer);