debugging reference and ownership issues

This commit is contained in:
2019-01-29 05:49:55 -08:00
parent 4075c95dff
commit 8d4e2f1c1e
4 changed files with 59 additions and 18 deletions

View File

@@ -4,6 +4,9 @@ use std::collections::HashMap;
use std::borrow::Cow;
use std::str::FromStr;
use sfml::graphics::IntRect;
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
pub fn read_spritesheet(filename: String) -> HashMap<String, HashMap<String, i32>> {
@@ -75,4 +78,11 @@ pub fn grab_sheet_rec(spritename: String, spritesheet: &HashMap<String, HashMap<
*block_desc.get("width").unwrap(),
*block_desc.get("height").unwrap()
)
}
pub fn read_map(filename: String) {
let file = File::open(filename).expect("Could not open file");
for line in BufReader::new(file).lines() {
println!("{:?}", line);
}
}