Created
August 5, 2014 09:53
-
-
Save tbillington/c973ec7f4ecd855ef514 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fn linked_face(vertexs: &[Rc<RefCell<Vertex>>], face: UnlinkedFace) -> Option<RefCell<Face>> { | |
let a = match vertexs.get(face.a) { | |
Some(x) => x.clone(), | |
None => return None, | |
}; | |
let b = match vertexs.get(face.b) { | |
Some(x) => x.clone(), | |
None => return None, | |
}; | |
let c = match vertexs.get(face.c) { | |
Some(x) => x.clone(), | |
None => return None, | |
}; | |
let d = match vertexs.get(face.d) { | |
Some(x) => x.clone(), | |
None => return None, | |
}; | |
Some(RefCell::new(Face { a: a, b: b, c: c, d: d })) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment