mirror of
https://codeberg.org/takouhai/strongbad_email.git
synced 2024-11-23 05:18:04 -05:00
fix: print all lines correctly and set title
This commit is contained in:
parent
e7bdc9c8a3
commit
a176e62ef4
1 changed files with 5 additions and 4 deletions
|
@ -16,14 +16,15 @@ struct Emails {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
println!("Preeeeow, world.");
|
||||
let the_paper = include_str!("sbemails.toml");
|
||||
let sbemails: Sbemails = toml::from_str(the_paper)
|
||||
.expect("failed to deserialize sbemails.toml");
|
||||
let mut random_number = thread_rng();
|
||||
let sbemail = sbemails.emails.choose(&mut random_number).unwrap();
|
||||
println!("sbemail number: {:?}", sbemail.number);
|
||||
println!("sbemail title: {:?}", sbemail.title);
|
||||
println!("sbemail content: {:?}", sbemail.content);
|
||||
println!("sbemail #{}: {}", sbemail.number, sbemail.title);
|
||||
let sbemail_content = sbemail.content.split("\n");
|
||||
for part in sbemail_content {
|
||||
println!("{}", part);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue