Created
April 8, 2019 13:57
-
-
Save shaver/4338f7c400f70b3115fc13872974aa97 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
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