Skip to content

Commit b9fbcca

Browse files
author
梶塚太智
committed
Update main.rs
refactoring
1 parent 498fb20 commit b9fbcca

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
use rand::seq::SliceRandom;
22
use regex::Regex;
3-
use rodio::Source;
4-
use rodio::{OutputStream, Sink};
3+
use rodio::{OutputStream, Sink, Source};
54
use std::collections::HashMap;
65
use std::env;
76
use std::fs::{self, File};
87
use std::io::{self, Error, Read, Write};
98
use std::path::Path;
10-
use std::thread;
11-
use std::thread::sleep;
9+
use std::thread::{self, sleep};
1210
use std::time::{Duration, SystemTime, UNIX_EPOCH};
1311

1412
fn main() {
@@ -471,7 +469,7 @@ impl Executor {
471469
}
472470
}
473471

474-
// Concat the string
472+
// Concatenate the string
475473
"concat" => {
476474
let b = self.pop_stack().get_string();
477475
let a = self.pop_stack().get_string();
@@ -589,7 +587,7 @@ impl Executor {
589587
let num_samples = (duration_secs * sample_rate) as usize;
590588
let samples: Vec<f32> = (0..num_samples)
591589
.map(|t| {
592-
let t = t as f64 / sample_rate as f64;
590+
let t = t as f64 / sample_rate;
593591
(t * frequency * 2.0 * std::f64::consts::PI).sin() as f32
594592
})
595593
.collect();
@@ -659,7 +657,7 @@ impl Executor {
659657
std::process::exit(status as i32);
660658
}
661659

662-
// Commands of string processing
660+
// Commands of list processing
663661

664662
// Get list value by index
665663
"get" => {

0 commit comments

Comments
 (0)