concatenate strings differently
This commit is contained in:
parent
1153385609
commit
a414d89859
7
build.rs
7
build.rs
@ -1,6 +1,7 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
use std::iter::once;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let out_dir = env::var_os("OUT_DIR").unwrap();
|
let out_dir = env::var_os("OUT_DIR").unwrap();
|
||||||
@ -41,7 +42,11 @@ fn main() {
|
|||||||
|
|
||||||
fs::write(
|
fs::write(
|
||||||
&dest_path,
|
&dest_path,
|
||||||
"vec![".to_string() + &lines.iter().map(|x|x.as_str()).collect::<String>() + "]"
|
once("vec![")
|
||||||
|
.chain(lines.iter()
|
||||||
|
.map(String::as_str)
|
||||||
|
.chain(once("]")))
|
||||||
|
.collect::<String>()
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
println!("cargo::rerun-if-changed=build.rs");
|
println!("cargo::rerun-if-changed=build.rs");
|
||||||
|
Loading…
Reference in New Issue
Block a user