Created
June 29, 2017 14:15
-
-
Save pnkfelix/ab4ab5db1b3d284478705587516360ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//use std::fs::OpenOptions; | |
use std::env; | |
#[derive(Debug, Default)] | |
pub struct Something { | |
field1: Vec<S1>, | |
field2: Vec<S2>, | |
field3: Vec<S3>, | |
field4: Vec<S4>, | |
field5: Vec<S5>, | |
field6: Vec<S6>, | |
field7: Vec<S7>, | |
field8: Vec<S8>, | |
field9: Vec<S9>, | |
} | |
#[derive(Debug, Default)] | |
pub struct S1(String); | |
#[derive(Debug, Default)] | |
pub struct S2(String); | |
#[derive(Debug, Default)] | |
pub struct S3(String); | |
#[derive(Debug, Default)] | |
pub struct S4(String); | |
#[derive(Debug, Default)] | |
pub struct S5(String); | |
#[derive(Debug, Default)] | |
pub struct S6(String); | |
#[derive(Debug, Default)] | |
pub struct S7(String); | |
#[derive(Debug, Default)] | |
pub struct S8(String); | |
#[derive(Debug, Default)] | |
pub struct S9(String); | |
fn main() { | |
let mut args = env::args(); | |
args.next(); | |
let arg1 = args.next().unwrap(); | |
let num: usize = arg1.parse().unwrap(); | |
let mut something: Something = Default::default(); | |
for _ in 0..num { | |
something.field1.push(Default::default()); | |
something.field2.push(Default::default()); | |
something.field3.push(Default::default()); | |
something.field4.push(Default::default()); | |
something.field5.push(Default::default()); | |
something.field6.push(Default::default()); | |
something.field7.push(Default::default()); | |
something.field8.push(Default::default()); | |
something.field9.push(Default::default()); | |
} | |
println!("{:?}", something); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment