Skip to content

Instantly share code, notes, and snippets.

@pnkfelix
Created June 29, 2017 14:15
Show Gist options
  • Save pnkfelix/ab4ab5db1b3d284478705587516360ce to your computer and use it in GitHub Desktop.
Save pnkfelix/ab4ab5db1b3d284478705587516360ce to your computer and use it in GitHub Desktop.
//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