Skip to content

Instantly share code, notes, and snippets.

@TheOpenDevProject
Created November 3, 2015 11:34
Show Gist options
  • Select an option

  • Save TheOpenDevProject/efa0bb2499bcdaa79292 to your computer and use it in GitHub Desktop.

Select an option

Save TheOpenDevProject/efa0bb2499bcdaa79292 to your computer and use it in GitHub Desktop.
//Basic stuff for our Xorg window
extern crate gl;
extern crate glutin;
extern crate libc;
use std::str::CharRange;
use std::error::Error;
use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
struct Vec3D{
X:f32,
Y:f32,
Z:f32
}
fn main() {
load_file();
}
fn load_file(){
let model_path = Path::new("/media/reverseinverse/Data/models/model.obj");
let mut file = match File::open(&model_path) {
Err(err_msg) => panic!("Could not load model"),
Ok(file) => file,
};
let mut file_content = String::new();
//Break up the object file for further processin
match file.read_to_string(&mut file_content){
Err(why) => panic!("Cant read file"),
Ok(_) => print!("File Read OK!"),
}
let mut model_split = file_content.split("\r\n");
#![feature(str_char, core)]
for line in model_split {
let CharIttr = {ch, next} = line.char_range_at(0);
if(ch == "v"){
print!("Line = {}\r\n",line);
}
}
}
@TheOpenDevProject
Copy link
Copy Markdown
Author

src/main.rs:37:4: 37:5 error: an inner attribute is not permitted in this context
src/main.rs:37  #![feature(str_char, core)]
                  ^
src/main.rs:37:4: 37:5 help: place inner attribute at the top of the module or block
src/main.rs:37:28: 37:29 error: expected item after attributes
src/main.rs:37  #![feature(str_char, core)]
                                          ^
src/main.rs:39:21: 39:22 error: expected one of `!`, `.`, `::`, `;`, `{`, `}`, or an operator, found `,`
src/main.rs:39      let CharIttr = {ch, next} = line.char_range_at(0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment