fs::create_dir
RS-W1032std::fs::create_dir
instead of std::fs::create_dir_all
93 // each audio file is in the form {id}.wav
94
95 for (language, audio_data) in output.into_iter() {
96 std::fs::create_dir(&language).expect("failed to create directory"); 97 let mut writer = csv::Writer::from_path(format!("{}/transcripts.csv", language))
98 .expect("failed to open transcripts.csv");
99 for (id, audio_data, transcript) in audio_data {
fs::create_dir_all
is preferable over fs::create_dir
as it creates all
missing components in the provided path without erroring out.
fs::create_dir("/some/path");
fs::create_dir_all("/some/path");