mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 23:36:30 +00:00
Don't be lazy, actually read the file instead of including it at compile time
This commit is contained in:
parent
70aa18699b
commit
426e5cf3f5
1 changed files with 5 additions and 2 deletions
|
@ -18,7 +18,10 @@ use std::io::prelude::*;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let template = include_str!("../../README-template.hbs");
|
let mut template_file = File::open("README-template.hbs").unwrap();
|
||||||
|
let mut template = String::new();
|
||||||
|
template_file.read_to_string(&mut template).unwrap();
|
||||||
|
|
||||||
let autogenerated_notice = "This file was autogenerated by the script in src/bin/generate_readme.rs.
|
let autogenerated_notice = "This file was autogenerated by the script in src/bin/generate_readme.rs.
|
||||||
Please edit either the script or the template in README-template.md in
|
Please edit either the script or the template in README-template.md in
|
||||||
order to make changes here rather than committing the changes directly.";
|
order to make changes here rather than committing the changes directly.";
|
||||||
|
@ -32,7 +35,7 @@ order to make changes here rather than committing the changes directly.";
|
||||||
generated_readme,
|
generated_readme,
|
||||||
"{}",
|
"{}",
|
||||||
hbs.render_template(
|
hbs.render_template(
|
||||||
template,
|
&template,
|
||||||
&json!({ "autogenerated_notice": autogenerated_notice }),
|
&json!({ "autogenerated_notice": autogenerated_notice }),
|
||||||
).unwrap()
|
).unwrap()
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
Loading…
Reference in a new issue