Replace hard split on \n with ::lines() + ::trim() to fix \r\n

This commit is contained in:
Leviathan Jeanis 2018-12-30 10:04:13 -06:00
parent 75e83860be
commit ba75072509
No known key found for this signature in database
GPG Key ID: 4EC2ABEB028B79EC

View File

@ -3,7 +3,7 @@ extern crate string_cache_codegen;
use std::{env, path::Path};
fn main() {
let strs = include_str!("words.txt").split("\n").collect::<Vec<_>>();
let strs = include_str!("words.txt").lines().map(|l| l.trim()).collect::<Vec<_>>();
gen("js_word", "JsWord", &strs);
}