fn write_file(output_path: &String, words: &Vec<String>) {
    let mut full_string: String = String::new();
    for word in words {
        full_string = full_string + word + "\n";
    }
    // NOTE: Remove the last "\n"
    full_string.truncate(full_string.len() - 1);
    if fs::write(output_path, full_string).is_err() {
        println!("Did not write to {}", output_path);
    }
}
/// Writes the valid dictionary words to a file.
/// Note:  The file will be *overwritten*
/// # Params
/// words:  &Vec<String>, dictionary data to be written to file.
/// output_path: &String, path to the output file.
Writes the valid dictionary words to a file.
Note:  The file will be *overwritten
Writes the valid dictionary words to a file . Note : The file will be * overwritten
fn write_file(output_path: &String, words: &Vec<String>) {
    let mut full_string: String = String::new();
    for word in words {
        full_string = full_string + word + "\n";
    }
    // NOTE: Remove the last "\n"
    full_string.truncate(full_string.len() - 1);
    if fs::write(output_path, full_string).is_err() {
        println!("Did not write to {}", output_path);
    }
}
fn write_file ( output_path : & String , words : & Vec < String > ) { let mut full_string : String = String :: new ( ) ; for word in words { full_string = full_string + word + " \n " ; } // NOTE: Remove the last "\n" full_string . truncate ( full_string . len ( ) - 1 ) ; if fs :: write ( output_path , full_string ) . is_err ( ) { println ! ( " " output_path ) ; } }
Writes the valid dictionary words to a file.
Writes the valid dictionary words to a file .
output_path
&String
words
&Vec<String>
output_path
&String
words
&Vec<String>
params
&Vec, dictionary data to be written to file.
output_path: &String, path to the output file.
&Vec dictionary data to be written to file . output_path : &String path to the output file .