@@ -360,38 +360,28 @@ impl AmplifierApp {
360360fn build_amplifier_chain ( stages : & [ StageConfig ] , sample_rate : f32 ) -> AmplifierChain {
361361 let mut chain = AmplifierChain :: new ( ) ;
362362
363- for ( idx , stage) in stages. iter ( ) . enumerate ( ) {
363+ for stage in stages. iter ( ) {
364364 match stage {
365365 StageConfig :: Filter ( cfg) => {
366- chain. add_stage ( Box :: new (
367- cfg. to_stage ( & format ! ( "Filter {idx}" ) , sample_rate) ,
368- ) ) ;
366+ chain. add_stage ( Box :: new ( cfg. to_stage ( sample_rate) ) ) ;
369367 }
370368 StageConfig :: Preamp ( cfg) => {
371- chain. add_stage ( Box :: new ( cfg. to_stage ( & format ! ( "Preamp {idx}" ) ) ) ) ;
369+ chain. add_stage ( Box :: new ( cfg. to_stage ( ) ) ) ;
372370 }
373371 StageConfig :: Compressor ( cfg) => {
374- chain. add_stage ( Box :: new (
375- cfg. to_stage ( & format ! ( "Compressor {idx}" ) , sample_rate) ,
376- ) ) ;
372+ chain. add_stage ( Box :: new ( cfg. to_stage ( sample_rate) ) ) ;
377373 }
378374 StageConfig :: ToneStack ( cfg) => {
379- chain. add_stage ( Box :: new (
380- cfg. to_stage ( & format ! ( "ToneStack {idx}" ) , sample_rate) ,
381- ) ) ;
375+ chain. add_stage ( Box :: new ( cfg. to_stage ( sample_rate) ) ) ;
382376 }
383377 StageConfig :: PowerAmp ( cfg) => {
384- chain. add_stage ( Box :: new (
385- cfg. to_stage ( & format ! ( "PowerAmp {idx}" ) , sample_rate) ,
386- ) ) ;
378+ chain. add_stage ( Box :: new ( cfg. to_stage ( sample_rate) ) ) ;
387379 }
388380 StageConfig :: Level ( cfg) => {
389- chain. add_stage ( Box :: new ( cfg. to_stage ( & format ! ( "Level {idx}" ) ) ) ) ;
381+ chain. add_stage ( Box :: new ( cfg. to_stage ( ) ) ) ;
390382 }
391383 StageConfig :: NoiseGate ( cfg) => {
392- chain. add_stage ( Box :: new (
393- cfg. to_stage ( & format ! ( "NoiseGate {idx}" ) , sample_rate) ,
394- ) ) ;
384+ chain. add_stage ( Box :: new ( cfg. to_stage ( sample_rate) ) ) ;
395385 }
396386 }
397387 }
0 commit comments