Last active
September 27, 2016 07:28
-
-
Save kellpossible/99d711c09d8fb90c4bb20abb54ba4fb9 to your computer and use it in GitHub Desktop.
rust lifetime error
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 Database<'a> { | |
pub fixes: Vec<Waypoint<'a>>, | |
pub countries: HashMap<String, Country>, | |
} | |
impl<'a> Database<'a> { | |
pub fn new(navdata_dir: PathBuf, resources_dir: PathBuf) -> Database<'a> { | |
let countries_path = resources_dir.join("icao_countries.txt"); | |
let countries_path = countries_path.to_str().unwrap(); | |
let waypoints_path = navdata_dir.join("waypoints.txt"); | |
let waypoints_path = waypoints_path.to_str().unwrap(); | |
let mut db = Database { | |
countries: HashMap::new(), | |
fixes: Vec::new() | |
}; | |
db.read_countries(countries_path); | |
db.read_fixes(waypoints_path); | |
return db; | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm getting this error: