|
1 | 1 | use rand::seq::SliceRandom;
|
2 | 2 | use regex::Regex;
|
3 |
| -use rodio::Source; |
4 |
| -use rodio::{OutputStream, Sink}; |
| 3 | +use rodio::{OutputStream, Sink, Source}; |
5 | 4 | use std::collections::HashMap;
|
6 | 5 | use std::env;
|
7 | 6 | use std::fs::{self, File};
|
8 | 7 | use std::io::{self, Error, Read, Write};
|
9 | 8 | use std::path::Path;
|
10 |
| -use std::thread; |
11 |
| -use std::thread::sleep; |
| 9 | +use std::thread::{self, sleep}; |
12 | 10 | use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
13 | 11 |
|
14 | 12 | fn main() {
|
@@ -471,7 +469,7 @@ impl Executor {
|
471 | 469 | }
|
472 | 470 | }
|
473 | 471 |
|
474 |
| - // Concat the string |
| 472 | + // Concatenate the string |
475 | 473 | "concat" => {
|
476 | 474 | let b = self.pop_stack().get_string();
|
477 | 475 | let a = self.pop_stack().get_string();
|
@@ -589,7 +587,7 @@ impl Executor {
|
589 | 587 | let num_samples = (duration_secs * sample_rate) as usize;
|
590 | 588 | let samples: Vec<f32> = (0..num_samples)
|
591 | 589 | .map(|t| {
|
592 |
| - let t = t as f64 / sample_rate as f64; |
| 590 | + let t = t as f64 / sample_rate; |
593 | 591 | (t * frequency * 2.0 * std::f64::consts::PI).sin() as f32
|
594 | 592 | })
|
595 | 593 | .collect();
|
@@ -659,7 +657,7 @@ impl Executor {
|
659 | 657 | std::process::exit(status as i32);
|
660 | 658 | }
|
661 | 659 |
|
662 |
| - // Commands of string processing |
| 660 | + // Commands of list processing |
663 | 661 |
|
664 | 662 | // Get list value by index
|
665 | 663 | "get" => {
|
|
0 commit comments