use std::fs::File;
use std::io::{ BufReader, BufRead };

struct Vertex {
	x: f32,
	y: f32,
	z: f32
}

pub struct WavefrontModel {
	vertices: Vec<Vertex>
}

impl WavefrontModel {
	pub fn new(path: &'static str) {
		let file = BufReader::new(File::open(&path).unwrap());

		for line in file.lines()  {
			println!("{}", line.unwrap())
		}
	}
}
use std::error::Error;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;

struct Vertex {
	x: f32,
	y: f32,
	z: f32
}

pub struct WavefrontModel {
	vertices: Vec<Vertex>
}

impl WavefrontModel {
	pub fn new(path: &'static str) {
		let mut file = match File::open(&path) {
			// The `description` method of `io::Error` returns a string that describes the error
			Err(why) => panic!("couldn't open {}", Error::description(&why)),
			Ok(file) => file,
		};

		// Read the file contents into a string, returns `io::Result<usize>`
		let mut s = String::new();

		match file.read_to_string(&mut s) {
			Err(why) => panic!("couldn't read {}", Error::description(&why)),
			Ok(_) => print!("{}", s),
		}
	}

	// fn parseLine(line)
}
--- 
+++ 
@@ -1,7 +1,5 @@
-use std::error::Error;
 use std::fs::File;
-use std::io::prelude::*;
-use std::path::Path;
+use std::io::{ BufReader, BufRead };
 
 struct Vertex {
 	x: f32,
@@ -15,20 +13,10 @@
 
 impl WavefrontModel {
 	pub fn new(path: &'static str) {
-		let mut file = match File::open(&path) {
-			// The `description` method of `io::Error` returns a string that describes the error
-			Err(why) => panic!("couldn't open {}", Error::description(&why)),
-			Ok(file) => file,
-		};
+		let file = BufReader::new(File::open(&path).unwrap());
 
-		// Read the file contents into a string, returns `io::Result<usize>`
-		let mut s = String::new();
-
-		match file.read_to_string(&mut s) {
-			Err(why) => panic!("couldn't read {}", Error::description(&why)),
-			Ok(_) => print!("{}", s),
+		for line in file.lines()  {
+			println!("{}", line.unwrap())
 		}
 	}
-
-	// fn parseLine(line)
 }
Print file line by line
