Skip to content

Instantly share code, notes, and snippets.

@shaver
Created April 8, 2019 13:57
Show Gist options
  • Save shaver/4338f7c400f70b3115fc13872974aa97 to your computer and use it in GitHub Desktop.
Save shaver/4338f7c400f70b3115fc13872974aa97 to your computer and use it in GitHub Desktop.
pub struct SkillRating {
_name: String,
_ratings: Vec<u32>
}
pub struct Job {
_name: String,
_skill_ratings: (SkillRating, SkillRating, SkillRating),
}
pub fn load_jobs(file: &str) -> Vec<Job> {
extern crate csv;
let jobs = vec![Job {
_name: "Dude".to_string(),
_skill_ratings: (
{
_name: String::from("Drinking"), // jobs.rs(17, 49): expecting a type here because of type ascription
//^^^^^^^^^^^
_ratings: vec![0; 32]
_},
{
_name: String::from("Drinking"),
_ratings: vec![0; 32]
_},
{
_name: String::from("Drinking"),
_ratings: vec![0; 32]
_}
)
}];
jobs
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment