Repository: brendanzab/gl-rs (language: rust)

Issue:
Homepage broken in crate page
Hi, homepage url is broken here:

https://crates.io/crates/gl_generator

Keep the good work!
Set up auto-upload of docs via Travis
I'm new to Rust, so I could be mistaken about this. Is there currently a problem with uploading the `gl-rs` docs to `rust-ci.org`? [This StackOverflow question](https://stackoverflow.com/questions/28196869/api-docs-for-gl-rs-rust-opengl-bindings/28200263?iemail=1&noredirect=1#28200263) is relevant.



Discussion / hints:

Look like `cargo doc` doesn't work at the moment:

```
$ cargo doc
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading log v0.2.1
Downloading xml-rs v0.1.16
An unknown error occurred
```

I'll need to set up auto-upload of the docs on travis


Fix patch:
diff --git a/.travis.yml b/.travis.yml
index 0ff9216f..f1e85dbd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,12 @@
 language: rust
 
-sudo: false
+rust:
+  - nightly
+  - beta
+  - stable
+
+cache: cargo
 
 script:
-  - ./bin/cargo test
+  - cargo build --all
+  - cargo test --all
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 00000000..a7ba97bd
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,12 @@
+[workspace]
+members = [
+    "gl",
+    "gl_generator",
+    "tests/test_add_registries",
+    "tests/test_gen_symbols",
+    "tests/test_no_warnings",
+    "tests/test_symbols",
+    "tests/test_unstable_api",
+    "tests/test_with_extensions",
+    "khronos_api",
+]
diff --git a/README.md b/README.md
index 52af5635..febff3a3 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # gl-rs
 
-[![Build Status](https://travis-ci.org/bjz/gl-rs.svg?branch=master)](https://travis-ci.org/bjz/gl-rs)
+[![Build Status](https://travis-ci.org/brendanzab/gl-rs.svg?branch=master)](https://travis-ci.org/brendanzab/gl-rs)
 
 ## Overview
 
@@ -12,9 +12,9 @@ The following crates are contained in this repository:
 
 ### gl
 
-[![Version](https://img.shields.io/crates/v/gl.svg)](https://crates.io/crates/gl) [![License](https://img.shields.io/crates/l/gl.svg)](https://github.com/bjz/gl-rs/blob/master/LICENSE) [![Downloads](https://img.shields.io/crates/d/gl.svg)](https://crates.io/crates/gl)
+[![Version](https://img.shields.io/crates/v/gl.svg)](https://crates.io/crates/gl) [![License](https://img.shields.io/crates/l/gl.svg)](https://github.com/brendanzab/gl-rs/blob/master/LICENSE) [![Downloads](https://img.shields.io/crates/d/gl.svg)](https://crates.io/crates/gl)
 
-[README](https://github.com/bjz/gl-rs/tree/master/gl)
+[README](https://github.com/brendanzab/gl-rs/tree/master/gl)
 
 An OpenGL function pointer loader for the Rust Programming Language.
 
@@ -25,9 +25,9 @@ gl = "0.6.0"
 
 ### gl_generator
 
-[![Version](https://img.shields.io/crates/v/gl_generator.svg)](https://crates.io/crates/gl_generator) [![License](https://img.shields.io/crates/l/gl_generator.svg)](https://github.com/bjz/gl-rs/blob/master/LICENSE) [![Downloads](https://img.shields.io/crates/d/gl_generator.svg)](https://crates.io/crates/gl_generator)
+[![Version](https://img.shields.io/crates/v/gl_generator.svg)](https://crates.io/crates/gl_generator) [![License](https://img.shields.io/crates/l/gl_generator.svg)](https://github.com/brendanzab/gl-rs/blob/master/LICENSE) [![Downloads](https://img.shields.io/crates/d/gl_generator.svg)](https://crates.io/crates/gl_generator)
 
-[README](https://github.com/bjz/gl-rs/tree/master/gl_generator)
+[README](https://github.com/brendanzab/gl-rs/tree/master/gl_generator)
 
 Code generators for creating bindings to the Khronos OpenGL APIs.
 
@@ -38,9 +38,9 @@ gl_generator = "0.5.0"
 
 ### khronos_api
 
-[![Version](https://img.shields.io/crates/v/khronos_api.svg)](https://crates.io/crates/khronos_api) [![License](https://img.shields.io/crates/l/khronos_api.svg)](https://github.com/bjz/gl-rs/blob/master/LICENSE) [![Downloads](https://img.shields.io/crates/d/khronos_api.svg)](https://crates.io/crates/khronos_api)
+[![Version](https://img.shields.io/crates/v/khronos_api.svg)](https://crates.io/crates/khronos_api) [![License](https://img.shields.io/crates/l/khronos_api.svg)](https://github.com/brendanzab/gl-rs/blob/master/LICENSE) [![Downloads](https://img.shields.io/crates/d/khronos_api.svg)](https://crates.io/crates/khronos_api)
 
-[README](https://github.com/bjz/gl-rs/tree/master/khronos_api)
+[README](https://github.com/brendanzab/gl-rs/tree/master/khronos_api)
 
 The Khronos XML API Registry, exposed as byte string constants.
 
@@ -57,5 +57,5 @@ khronos_api = "1.0.0"
 git submodule update --init
 ```
 
-A batch cargo script is provided at `bin/cargo`. [See the script](https://github.com/bjz/gl-rs/blob/master/bin/cargo)
+A batch cargo script is provided at `bin/cargo`. [See the script](https://github.com/brendanzab/gl-rs/blob/master/bin/cargo)
 for some example usages.
diff --git a/bin/cargo b/bin/cargo
deleted file mode 100755
index aec923c9..00000000
--- a/bin/cargo
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-# Runs a cargo command on each of the crates
-#
-# Example usage:
-#
-#      $ bin/cargo clean
-#      $ bin/cargo build
-#      $ bin/cargo test --verbose
-#      $ FILTER=tests bin/cargo test
-#      $ FILTER=crates bin/cargo build
-#      $ TEST="no_warnings gen_symbols" bin/cargo test
-
-export CARGO_TARGET_DIR=./target
-
-CRATE_PATHS=( gl/ gl_generator/ khronos_api/ )
-TEST_PATHS=( gl_tests/test_*/ )
-ALL_PATHS=( ${CRATE_PATHS[@]} ${TEST_PATHS[@]} )
-
-if [ -z "${TEST}" ]; then
-  case $FILTER in
-    'crates' ) PATHS=( ${CRATE_PATHS[@]} ) ;;
-    'tests' ) PATHS=( ${TEST_PATHS[@]} ) ;;
-    * )  PATHS=( ${ALL_PATHS[@]} ) ;;
-  esac
-else
-  PATHS=( $TEST )
-  PATHS=( ${PATHS[@]/#/gl_tests/test_} )
-  PATHS=( ${PATHS[@]/%//} )
-fi
-
-export RUST_BACKTRACE=1
-
-echo ${PATHS[@]/%/Cargo.toml} \
-  | xargs -n 1 -t cargo $* --manifest-path
diff --git a/gl/Cargo.toml b/gl/Cargo.toml
index c0533eeb..c657eba2 100644
--- a/gl/Cargo.toml
+++ b/gl/Cargo.toml
@@ -8,13 +8,13 @@ authors = ["Brendan Zabarauskas <bjzaba@yahoo.com.au>",
 description = "OpenGL bindings"
 license = "Apache-2.0"
 build = "build.rs"
-
-homepage = "https://github.com/bjz/gl-rs/gl/"
-repository = "https://github.com/bjz/gl-rs/"
+documentation = "https://docs.rs/gl"
+homepage = "https://github.com/brendanzab/gl-rs/gl/"
+repository = "https://github.com/brendanzab/gl-rs/"
 readme = "README.md"
 
 [build-dependencies]
 gl_generator = { version = "0.5.2", path = "../gl_generator" }
 
 [dev-dependencies]
-glutin = "0.4"
+glutin = "0.7"
diff --git a/gl/README.md b/gl/README.md
index 0d2c4742..c6016eb1 100644
--- a/gl/README.md
+++ b/gl/README.md
@@ -1,7 +1,7 @@
 # gl-rs
 
 [![Version](https://img.shields.io/crates/v/gl.svg)](https://crates.io/crates/gl)
-[![License](https://img.shields.io/crates/l/gl.svg)](https://github.com/bjz/gl-rs/blob/master/LICENSE)
+[![License](https://img.shields.io/crates/l/gl.svg)](https://github.com/brendanzab/gl-rs/blob/master/LICENSE)
 [![Downloads](https://img.shields.io/crates/d/gl.svg)](https://crates.io/crates/gl)
 
 An OpenGL function pointer loader for the Rust Programming Language.
@@ -24,7 +24,7 @@ use gl::types::*;
 You must load the function pointers into their respective function pointers
 using the `load_with` function. You must supply a loader function from your
 context library, This is how it would look using [glfw-rs]
-(https://github.com/bjz/glfw-rs):
+(https://github.com/brendanzab/glfw-rs):
 
 ```rust
 // the supplied function must be of the type:
diff --git a/gl/examples/triangle.rs b/gl/examples/triangle.rs
index 8839e4f1..222e55a4 100644
--- a/gl/examples/triangle.rs
+++ b/gl/examples/triangle.rs
@@ -22,22 +22,16 @@ use std::str;
 use std::ffi::CString;
 
 // Vertex data
-static VERTEX_DATA: [GLfloat; 6] = [
-     0.0,  0.5,
-     0.5, -0.5,
-    -0.5, -0.5
-];
+static VERTEX_DATA: [GLfloat; 6] = [0.0, 0.5, 0.5, -0.5, -0.5, -0.5];
 
 // Shader sources
-static VS_SRC: &'static str =
-   "#version 150\n\
+static VS_SRC: &'static str = "#version 150\n\
     in vec2 position;\n\
     void main() {\n\
        gl_Position = vec4(position, 0.0, 1.0);\n\
     }";
 
-static FS_SRC: &'static str =
-   "#version 150\n\
+static FS_SRC: &'static str = "#version 150\n\
     out vec4 out_color;\n\
     void main() {\n\
        out_color = vec4(1.0, 1.0, 1.0, 1.0);\n\
@@ -62,33 +56,47 @@ fn compile_shader(src: &str, ty: GLenum) -> GLuint {
             gl::GetShaderiv(shader, gl::INFO_LOG_LENGTH, &mut len);
             let mut buf = Vec::with_capacity(len as usize);
             buf.set_len((len as usize) - 1); // subtract 1 to skip the trailing null character
-            gl::GetShaderInfoLog(shader, len, ptr::null_mut(), buf.as_mut_ptr() as *mut GLchar);
-            panic!("{}", str::from_utf8(&buf).ok().expect("ShaderInfoLog not valid utf8"));
+            gl::GetShaderInfoLog(shader,
+                                 len,
+                                 ptr::null_mut(),
+                                 buf.as_mut_ptr() as *mut GLchar);
+            panic!("{}",
+                   str::from_utf8(&buf)
+                       .ok()
+                       .expect("ShaderInfoLog not valid utf8"));
         }
     }
     shader
 }
 
-fn link_program(vs: GLuint, fs: GLuint) -> GLuint { unsafe {
-    let program = gl::CreateProgram();
-    gl::AttachShader(program, vs);
-    gl::AttachShader(program, fs);
-    gl::LinkProgram(program);
-    // Get the link status
-    let mut status = gl::FALSE as GLint;
-    gl::GetProgramiv(program, gl::LINK_STATUS, &mut status);
-
-    // Fail on error
-    if status != (gl::TRUE as GLint) {
-        let mut len: GLint = 0;
-        gl::GetProgramiv(program, gl::INFO_LOG_LENGTH, &mut len);
-        let mut buf = Vec::with_capacity(len as usize);
-        buf.set_len((len as usize) - 1); // subtract 1 to skip the trailing null character
-        gl::GetProgramInfoLog(program, len, ptr::null_mut(), buf.as_mut_ptr() as *mut GLchar);
-        panic!("{}", str::from_utf8(&buf).ok().expect("ProgramInfoLog not valid utf8"));
+fn link_program(vs: GLuint, fs: GLuint) -> GLuint {
+    unsafe {
+        let program = gl::CreateProgram();
+        gl::AttachShader(program, vs);
+        gl::AttachShader(program, fs);
+        gl::LinkProgram(program);
+        // Get the link status
+        let mut status = gl::FALSE as GLint;
+        gl::GetProgramiv(program, gl::LINK_STATUS, &mut status);
+
+        // Fail on error
+        if status != (gl::TRUE as GLint) {
+            let mut len: GLint = 0;
+            gl::GetProgramiv(program, gl::INFO_LOG_LENGTH, &mut len);
+            let mut buf = Vec::with_capacity(len as usize);
+            buf.set_len((len as usize) - 1); // subtract 1 to skip the trailing null character
+            gl::GetProgramInfoLog(program,
+                                  len,
+                                  ptr::null_mut(),
+                                  buf.as_mut_ptr() as *mut GLchar);
+            panic!("{}",
+                   str::from_utf8(&buf)
+                       .ok()
+                       .expect("ProgramInfoLog not valid utf8"));
+        }
+        program
     }
-    program
-} }
+}
 
 fn main() {
     let window = glutin::Window::new().unwrap();
@@ -123,15 +131,17 @@ fn main() {
 
         // Use shader program
         gl::UseProgram(program);
-        gl::BindFragDataLocation(program, 0,
-                                 CString::new("out_color").unwrap().as_ptr());
+        gl::BindFragDataLocation(program, 0, CString::new("out_color").unwrap().as_ptr());
 
         // Specify the layout of the vertex data
-        let pos_attr = gl::GetAttribLocation(program,
-                                             CString::new("position").unwrap().as_ptr());
+        let pos_attr = gl::GetAttribLocation(program, CString::new("position").unwrap().as_ptr());
         gl::EnableVertexAttribArray(pos_attr as GLuint);
-        gl::VertexAttribPointer(pos_attr as GLuint, 2, gl::FLOAT,
-                                gl::FALSE as GLboolean, 0, ptr::null());
+        gl::VertexAttribPointer(pos_attr as GLuint,
+                                2,
+                                gl::FLOAT,
+                                gl::FALSE as GLboolean,
+                                0,
+                                ptr::null());
     }
 
     for event in window.wait_events() {
diff --git a/gl/src/lib.rs b/gl/src/lib.rs
index 949cf1a0..0b28d2fc 100644
--- a/gl/src/lib.rs
+++ b/gl/src/lib.rs
@@ -28,7 +28,7 @@
 //! You can load the function pointers into their respective function pointers
 //! using the `load_with` function. You must supply a loader function from your
 //! context library, This is how it would look using [glfw-rs]
-//! (https://github.com/bjz/glfw-rs):
+//! (https://github.com/brendanzab/glfw-rs):
 //!
 //! ~~~ignore
 //! // the supplied function must be of the type:
diff --git a/gl_generator/Cargo.toml b/gl_generator/Cargo.toml
index 444cfa50..2a55f4f0 100644
--- a/gl_generator/Cargo.toml
+++ b/gl_generator/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-
 name = "gl_generator"
 version = "0.5.2"
 authors = ["Brendan Zabarauskas <bjzaba@yahoo.com.au>",
@@ -8,9 +7,9 @@ authors = ["Brendan Zabarauskas <bjzaba@yahoo.com.au>",
 ]
 description = "Code generators for creating bindings to the Khronos OpenGL APIs."
 license = "Apache-2.0"
-
-homepage = "https://github.com/bjz/gl-rs/gl_generator/"
-repository = "https://github.com/bjz/gl-rs/"
+documentation = "https://docs.rs/gl_generator"
+homepage = "https://github.com/brendanzab/gl-rs/gl_generator/"
+repository = "https://github.com/brendanzab/gl-rs/"
 readme = "README.md"
 
 [lib]
diff --git a/gl_generator/README.md b/gl_generator/README.md
index e870a2c2..ddafa2ca 100644
--- a/gl_generator/README.md
+++ b/gl_generator/README.md
@@ -1,7 +1,7 @@
 # gl_generator
 
 [![Version](https://img.shields.io/crates/v/gl_generator.svg)](https://crates.io/crates/gl_generator)
-[![License](https://img.shields.io/crates/l/gl_generator.svg)](https://github.com/bjz/gl-rs/blob/master/LICENSE)
+[![License](https://img.shields.io/crates/l/gl_generator.svg)](https://github.com/brendanzab/gl-rs/blob/master/LICENSE)
 [![Downloads](https://img.shields.io/crates/d/gl_generator.svg)](https://crates.io/crates/gl_generator)
 
 Code generators for creating bindings to the Khronos OpenGL APIs.
diff --git a/gl_generator/generators/debug_struct_gen.rs b/gl_generator/generators/debug_struct_gen.rs
index dbb70edd..5b8c566c 100644
--- a/gl_generator/generators/debug_struct_gen.rs
+++ b/gl_generator/generators/debug_struct_gen.rs
@@ -19,7 +19,9 @@ use std::io;
 pub struct DebugStructGenerator;
 
 impl super::Generator for DebugStructGenerator {
-    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()>
+        where W: io::Write
+    {
         try!(write_header(dest));
         try!(write_type_aliases(registry, dest));
         try!(write_enums(registry, dest));
@@ -33,8 +35,11 @@ impl super::Generator for DebugStructGenerator {
 
 /// Creates a `__gl_imports` module which contains all the external symbols that we need for the
 ///  bindings.
-fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, r#"
+fn write_header<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             r#"
         mod __gl_imports {{
             pub use std::mem;
             pub use std::marker::Send;
@@ -46,8 +51,11 @@ fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
 /// Creates a `types` module which contains all the type aliases.
 ///
 /// See also `generators::gen_types`.
-fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, r#"
+fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  r#"
         pub mod types {{
             #![allow(non_camel_case_types, non_snake_case, dead_code, missing_copy_implementations)]
     "#));
@@ -58,7 +66,9 @@ fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> wh
 }
 
 /// Creates all the `<enum>` elements at the root of the bindings.
-fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     for enm in &registry.enums {
         try!(super::gen_enum_item(enm, "types::", dest));
     }
@@ -67,8 +77,11 @@ fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 }
 
 /// Creates a `FnPtr` structure which contains the store for a single binding.
-fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, "
+fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             "
         #[allow(dead_code, missing_copy_implementations)]
         #[derive(Clone)]
         pub struct FnPtr {{
@@ -106,26 +119,29 @@ fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()> where W: io::Write
 /// Creates a `panicking` module which contains one function per GL command.
 ///
 /// These functions are the mocks that are called if the real function could not be loaded.
-fn write_panicking_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_panicking_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     writeln!(dest,
-        "#[inline(never)]
+             "#[inline(never)]
         fn missing_fn_panic() -> ! {{
             panic!(\"{api} function was not loaded\")
         }}",
-        api = registry.api
-    )
+             api = registry.api)
 }
 
 /// Creates a structure which stores all the `FnPtr` of the bindings.
 ///
 /// The name of the struct corresponds to the namespace.
-fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, "
+fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  "
         #[allow(non_camel_case_types, non_snake_case, dead_code)]
         #[derive(Clone)]
         pub struct {api} {{",
-        api = super::gen_struct_name(registry.api)
-    ));
+                  api = super::gen_struct_name(registry.api)));
 
     for cmd in &registry.cmds {
         if let Some(v) = registry.aliases.get(&cmd.proto.ident) {
@@ -138,9 +154,11 @@ fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 }
 
 /// Creates the `impl` of the structure created by `write_struct`.
-fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     try!(writeln!(dest,
-        "impl {api} {{
+                  "impl {api} {{
             /// Load each OpenGL symbol using a custom load function. This allows for the
             /// use of functions like `glfwGetProcAddress` or `SDL_GL_GetProcAddress`.
             ///
@@ -167,8 +185,7 @@ fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
                     do_metaloadfn(&mut loadfn, symbol, symbols)
                 }};
                 {api} {{",
-        api = super::gen_struct_name(registry.api)
-    ));
+                  api = super::gen_struct_name(registry.api)));
 
     for cmd in &registry.cmds {
         try!(writeln!(dest,
@@ -187,27 +204,31 @@ fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
     }
 
     try!(writeln!(dest,
-            "}}
-        }}"
-    ));
+                  "}}
+        }}"));
 
     for cmd in &registry.cmds {
         let idents = super::gen_parameters(cmd, true, false);
         let typed_params = super::gen_parameters(cmd, false, true);
         let println = format!("println!(\"[OpenGL] {}({})\" {});",
-                                cmd.proto.ident,
-                                (0 .. idents.len()).map(|_| "{:?}".to_string()).collect::<Vec<_>>().join(", "),
-                                idents.iter().zip(typed_params.iter())
-                                      .map(|(name, ty)| {
-                                          if ty.contains("GLDEBUGPROC") {
-                                              format!(", \"<callback>\"")
-                                          } else {
-                                              format!(", {}", name)
-                                          }
-                                      }).collect::<Vec<_>>().concat());
+                              cmd.proto.ident,
+                              (0..idents.len())
+                                  .map(|_| "{:?}".to_string())
+                                  .collect::<Vec<_>>()
+                                  .join(", "),
+                              idents
+                                  .iter()
+                                  .zip(typed_params.iter())
+                                  .map(|(name, ty)| if ty.contains("GLDEBUGPROC") {
+                                           format!(", \"<callback>\"")
+                                       } else {
+                                           format!(", {}", name)
+                                       })
+                                  .collect::<Vec<_>>()
+                                  .concat());
 
         try!(writeln!(dest,
-            "#[allow(non_snake_case, unused_variables, dead_code)]
+                      "#[allow(non_snake_case, unused_variables, dead_code)]
             #[inline] pub unsafe fn {name}(&self, {params}) -> {return_suffix} {{ \
                 {println}
                 let r = __gl_imports::mem::transmute::<_, extern \"system\" fn({typed_params}) -> {return_suffix}>\
@@ -215,25 +236,28 @@ fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
                 {print_err}
                 r
             }}",
-            name = cmd.proto.ident,
-            params = super::gen_parameters(cmd, true, true).join(", "),
-            typed_params = typed_params.join(", "),
-            return_suffix = cmd.proto.ty,
-            idents = idents.join(", "),
-            println = println,
-            print_err = if cmd.proto.ident != "GetError" && registry.cmds.iter().find(|cmd| cmd.proto.ident == "GetError").is_some() {
-                format!(r#"match __gl_imports::mem::transmute::<_, extern "system" fn() -> u32>
+                      name = cmd.proto.ident,
+                      params = super::gen_parameters(cmd, true, true).join(", "),
+                      typed_params = typed_params.join(", "),
+                      return_suffix = cmd.proto.ty,
+                      idents = idents.join(", "),
+                      println = println,
+                      print_err = if cmd.proto.ident != "GetError" &&
+                                     registry
+                                         .cmds
+                                         .iter()
+                                         .find(|cmd| cmd.proto.ident == "GetError")
+                                         .is_some() {
+                          format!(r#"match __gl_imports::mem::transmute::<_, extern "system" fn() -> u32>
                     (self.GetError.f)() {{ 0 => (), r => println!("[OpenGL] ^ GL error triggered: {{}}", r) }}"#)
-            } else {
-                format!("")
-            }
-        ))
+                      } else {
+                          format!("")
+                      }))
     }
 
     writeln!(dest,
-        "}}
+             "}}
 
         unsafe impl __gl_imports::Send for {api} {{}}",
-        api = super::gen_struct_name(registry.api)
-    )
+             api = super::gen_struct_name(registry.api))
 }
diff --git a/gl_generator/generators/global_gen.rs b/gl_generator/generators/global_gen.rs
index 27a3bb39..2caa6348 100644
--- a/gl_generator/generators/global_gen.rs
+++ b/gl_generator/generators/global_gen.rs
@@ -19,7 +19,9 @@ use std::io;
 pub struct GlobalGenerator;
 
 impl super::Generator for GlobalGenerator {
-    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()>
+        where W: io::Write
+    {
         try!(write_header(dest));
         try!(write_metaloadfn(dest));
         try!(write_type_aliases(registry, dest));
@@ -36,8 +38,11 @@ impl super::Generator for GlobalGenerator {
 
 /// Creates a `__gl_imports` module which contains all the external symbols that we need for the
 ///  bindings.
-fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, r#"
+fn write_header<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             r#"
         mod __gl_imports {{
             pub use std::mem;
             pub use std::os::raw;
@@ -46,8 +51,11 @@ fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
 }
 
 /// Creates the metaloadfn function for fallbacks
-fn write_metaloadfn<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, r#"
+fn write_metaloadfn<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             r#"
         #[inline(never)]
         fn metaloadfn(mut loadfn: &mut FnMut(&str) -> *const __gl_imports::raw::c_void,
                       symbol: &str,
@@ -67,21 +75,27 @@ fn write_metaloadfn<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
 /// Creates a `types` module which contains all the type aliases.
 ///
 /// See also `generators::gen_types`.
-fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, r#"
+fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  r#"
         pub mod types {{
             #![allow(non_camel_case_types, non_snake_case, dead_code, missing_copy_implementations)]
     "#));
 
     try!(super::gen_types(registry.api, dest));
 
-    writeln!(dest, "
+    writeln!(dest,
+             "
         }}
     ")
 }
 
 /// Creates all the `<enum>` elements at the root of the bindings.
-fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     for enm in &registry.enums {
         try!(super::gen_enum_item(enm, "types::", dest));
     }
@@ -93,7 +107,9 @@ fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 ///
 /// The function calls the corresponding function pointer stored in the `storage` module created
 ///  by `write_ptrs`.
-fn write_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     for cmd in &registry.cmds {
         if let Some(v) = registry.aliases.get(&cmd.proto.ident) {
             try!(writeln!(dest, "/// Fallbacks: {}", v.join(", ")));
@@ -117,8 +133,11 @@ fn write_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io
 }
 
 /// Creates a `FnPtr` structure which contains the store for a single binding.
-fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, "
+fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             "
         #[allow(missing_copy_implementations)]
         pub struct FnPtr {{
             /// The function pointer that will be used when calling the function.
@@ -141,10 +160,12 @@ fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()> where W: io::Write
 }
 
 /// Creates a `storage` module which contains a static `FnPtr` per GL command in the registry.
-fn write_ptrs<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_ptrs<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
 
     try!(writeln!(dest,
-        "mod storage {{
+                  "mod storage {{
             #![allow(non_snake_case)]
             #![allow(non_upper_case_globals)]
             use super::__gl_imports::raw;
@@ -152,12 +173,11 @@ fn write_ptrs<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
 
     for c in &registry.cmds {
         try!(writeln!(dest,
-            "pub static mut {name}: FnPtr = FnPtr {{
+                      "pub static mut {name}: FnPtr = FnPtr {{
                 f: super::missing_fn_panic as *const raw::c_void,
                 is_loaded: false
             }};",
-            name = c.proto.ident
-        ));
+                      name = c.proto.ident));
     }
 
     writeln!(dest, "}}")
@@ -167,13 +187,18 @@ fn write_ptrs<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
 ///
 /// Each module contains `is_loaded` and `load_with` which interact with the `storage` module
 ///  created by `write_ptrs`.
-fn write_fn_mods<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_fn_mods<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     for c in &registry.cmds {
         let fallbacks = match registry.aliases.get(&c.proto.ident) {
             Some(v) => {
-                let names = v.iter().map(|name| format!("\"{}\"", super::gen_symbol_name(registry.api, &name[..]))).collect::<Vec<_>>();
+                let names = v.iter()
+                    .map(|name| format!("\"{}\"", super::gen_symbol_name(registry.api, &name[..])))
+                    .collect::<Vec<_>>();
                 format!("&[{}]", names.join(", "))
-            }, None => "&[]".to_string(),
+            }
+            None => "&[]".to_string(),
         };
         let fnname = &c.proto.ident[..];
         let symbol = super::gen_symbol_name(registry.api, &c.proto.ident[..]);
@@ -208,20 +233,26 @@ fn write_fn_mods<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W
 /// Creates a `missing_fn_panic` function.
 ///
 /// This function is the mock that is called if the real function could not be called.
-fn write_panicking_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_panicking_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     writeln!(dest,
-        "#[inline(never)]
+             "#[inline(never)]
         fn missing_fn_panic() -> ! {{
             panic!(\"{api} function was not loaded\")
         }}
-        ", api = registry.api)
+        ",
+             api = registry.api)
 }
 
 /// Creates the `load_with` function.
 ///
 /// The function calls `load_with` in each module created by `write_fn_mods`.
-fn write_load_fn<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, "
+fn write_load_fn<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  "
         /// Load each OpenGL symbol using a custom load function. This allows for the
         /// use of functions like `glfwGetProcAddress` or `SDL_GL_GetProcAddress`.
         /// ~~~ignore
@@ -232,11 +263,13 @@ fn write_load_fn<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W
     "));
 
     for c in &registry.cmds {
-        try!(writeln!(dest, "{cmd_name}::load_with(|s| loadfn(s));",
+        try!(writeln!(dest,
+                      "{cmd_name}::load_with(|s| loadfn(s));",
                       cmd_name = &c.proto.ident[..]));
     }
 
-    writeln!(dest, "
+    writeln!(dest,
+             "
         }}
     ")
 }
diff --git a/gl_generator/generators/mod.rs b/gl_generator/generators/mod.rs
index 9a432717..59c5b3ec 100644
--- a/gl_generator/generators/mod.rs
+++ b/gl_generator/generators/mod.rs
@@ -30,7 +30,7 @@ pub trait Generator {
 
 pub fn gen_struct_name(api: Api) -> &'static str {
     match api {
-        Api::Gl  => "Gl",
+        Api::Gl => "Gl",
         Api::Glx => "Glx",
         Api::Wgl => "Wgl",
         Api::Egl => "Egl",
@@ -41,7 +41,9 @@ pub fn gen_struct_name(api: Api) -> &'static str {
 }
 
 /// This function generates a `const name: type = value;` item.
-pub fn gen_enum_item<W>(enm: &Enum, types_prefix: &str, dest: &mut W) -> io::Result<()> where W: io::Write {
+pub fn gen_enum_item<W>(enm: &Enum, types_prefix: &str, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     writeln!(dest,
         "#[allow(dead_code, non_upper_case_globals)] pub const {ident}: {types_prefix}{ty} = {value}{cast_suffix};",
         ident = enm.ident,
@@ -59,14 +61,16 @@ pub fn gen_enum_item<W>(enm: &Enum, types_prefix: &str, dest: &mut W) -> io::Res
 ///
 /// Aliases are either `pub type = ...` or `#[repr(C)] pub struct ... { ... }` and contain all the
 /// things that we can't obtain from the XML files.
-pub fn gen_types<W>(api: Api, dest: &mut W) -> io::Result<()> where W: io::Write {
+pub fn gen_types<W>(api: Api, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     try!(writeln!(dest, "{}", include_str!("templates/types/gl.rs")));
 
     match api {
         Api::Glx => try!(writeln!(dest, "{}", include_str!("templates/types/glx.rs"))),
         Api::Wgl => try!(writeln!(dest, "{}", include_str!("templates/types/wgl.rs"))),
         Api::Egl => try!(writeln!(dest, "{}", include_str!("templates/types/egl.rs"))),
-        _ => {},
+        _ => {}
     }
 
     Ok(())
@@ -74,7 +78,8 @@ pub fn gen_types<W>(api: Api, dest: &mut W) -> io::Result<()> where W: io::Write
 
 /// Generates the list of Rust `Arg`s that a `Cmd` requires.
 pub fn gen_parameters(cmd: &Cmd, with_idents: bool, with_types: bool) -> Vec<String> {
-    cmd.params.iter()
+    cmd.params
+        .iter()
         .map(|binding| {
             // returning
             if with_idents && with_types {
diff --git a/gl_generator/generators/static_gen.rs b/gl_generator/generators/static_gen.rs
index fbcfa464..cbab248b 100644
--- a/gl_generator/generators/static_gen.rs
+++ b/gl_generator/generators/static_gen.rs
@@ -19,7 +19,9 @@ use std::io;
 pub struct StaticGenerator;
 
 impl super::Generator for StaticGenerator {
-    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()>
+        where W: io::Write
+    {
         try!(write_header(dest));
         try!(write_type_aliases(registry, dest));
         try!(write_enums(registry, dest));
@@ -30,8 +32,11 @@ impl super::Generator for StaticGenerator {
 
 /// Creates a `__gl_imports` module which contains all the external symbols that we need for the
 ///  bindings.
-fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, r#"
+fn write_header<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             r#"
         mod __gl_imports {{
             pub use std::mem;
             pub use std::os::raw;
@@ -42,21 +47,27 @@ fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
 /// Creates a `types` module which contains all the type aliases.
 ///
 /// See also `generators::gen_types`.
-fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, r#"
+fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  r#"
         pub mod types {{
             #![allow(non_camel_case_types, non_snake_case, dead_code, missing_copy_implementations)]
     "#));
 
     try!(super::gen_types(registry.api, dest));
 
-    writeln!(dest, "
+    writeln!(dest,
+             "
         }}
     ")
 }
 
 /// Creates all the `<enum>` elements at the root of the bindings.
-fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     for enm in &registry.enums {
         try!(super::gen_enum_item(enm, "types::", dest));
     }
@@ -67,8 +78,11 @@ fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 /// io::Writes all functions corresponding to the GL bindings.
 ///
 /// These are foreign functions, they don't have any content.
-fn write_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, "
+fn write_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  "
         #[allow(non_snake_case, unused_variables, dead_code)]
         extern \"system\" {{"));
 
diff --git a/gl_generator/generators/static_struct_gen.rs b/gl_generator/generators/static_struct_gen.rs
index 638bf27b..9ec604e7 100644
--- a/gl_generator/generators/static_struct_gen.rs
+++ b/gl_generator/generators/static_struct_gen.rs
@@ -19,7 +19,9 @@ use std::io;
 pub struct StaticStructGenerator;
 
 impl super::Generator for StaticStructGenerator {
-    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()>
+        where W: io::Write
+    {
         try!(write_header(dest));
         try!(write_type_aliases(registry, dest));
         try!(write_enums(registry, dest));
@@ -32,8 +34,11 @@ impl super::Generator for StaticStructGenerator {
 
 /// Creates a `__gl_imports` module which contains all the external symbols that we need for the
 ///  bindings.
-fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, r#"
+fn write_header<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             r#"
         mod __gl_imports {{
             pub use std::mem;
             pub use std::os::raw;
@@ -44,8 +49,11 @@ fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
 /// Creates a `types` module which contains all the type aliases.
 ///
 /// See also `generators::gen_types`.
-fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, r#"
+fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  r#"
         pub mod types {{
             #![allow(non_camel_case_types, non_snake_case, dead_code, missing_copy_implementations)]
     "#));
@@ -56,7 +64,9 @@ fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> wh
 }
 
 /// Creates all the `<enum>` elements at the root of the bindings.
-fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     for enm in &registry.enums {
         try!(super::gen_enum_item(enm, "types::", dest));
     }
@@ -67,7 +77,9 @@ fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 /// Creates a stub structure.
 ///
 /// The name of the struct corresponds to the namespace.
-fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     writeln!(dest, "
         #[allow(non_camel_case_types, non_snake_case, dead_code)]
         #[derive(Copy, Clone)]
@@ -77,7 +89,9 @@ fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 }
 
 /// Creates the `impl` of the structure created by `write_struct`.
-fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     try!(writeln!(dest,
         "impl {api} {{
             /// Stub function.
@@ -110,9 +124,12 @@ fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
 /// io::Writes all functions corresponding to the GL bindings.
 ///
 /// These are foreign functions, they don't have any content.
-fn write_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
 
-    try!(writeln!(dest, "
+    try!(writeln!(dest,
+                  "
         #[allow(non_snake_case)]
         #[allow(unused_variables)]
         #[allow(dead_code)]
diff --git a/gl_generator/generators/struct_gen.rs b/gl_generator/generators/struct_gen.rs
index d3c10e94..f6902bc4 100644
--- a/gl_generator/generators/struct_gen.rs
+++ b/gl_generator/generators/struct_gen.rs
@@ -19,7 +19,9 @@ use std::io;
 pub struct StructGenerator;
 
 impl super::Generator for StructGenerator {
-    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+    fn write<W>(&self, registry: &Registry, dest: &mut W) -> io::Result<()>
+        where W: io::Write
+    {
         try!(write_header(dest));
         try!(write_type_aliases(registry, dest));
         try!(write_enums(registry, dest));
@@ -33,8 +35,11 @@ impl super::Generator for StructGenerator {
 
 /// Creates a `__gl_imports` module which contains all the external symbols that we need for the
 ///  bindings.
-fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, r#"
+fn write_header<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             r#"
         mod __gl_imports {{
             pub use std::mem;
             pub use std::marker::Send;
@@ -46,8 +51,11 @@ fn write_header<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
 /// Creates a `types` module which contains all the type aliases.
 ///
 /// See also `generators::gen_types`.
-fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, r#"
+fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  r#"
         pub mod types {{
             #![allow(non_camel_case_types, non_snake_case, dead_code, missing_copy_implementations)]
     "#));
@@ -58,7 +66,9 @@ fn write_type_aliases<W>(registry: &Registry, dest: &mut W) -> io::Result<()> wh
 }
 
 /// Creates all the `<enum>` elements at the root of the bindings.
-fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     for enm in &registry.enums {
         try!(super::gen_enum_item(enm, "types::", dest));
     }
@@ -67,8 +77,11 @@ fn write_enums<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 }
 
 /// Creates a `FnPtr` structure which contains the store for a single binding.
-fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()> where W: io::Write {
-    writeln!(dest, "
+fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    writeln!(dest,
+             "
         #[allow(dead_code, missing_copy_implementations)]
         #[derive(Clone)]
         pub struct FnPtr {{
@@ -106,26 +119,29 @@ fn write_fnptr_struct_def<W>(dest: &mut W) -> io::Result<()> where W: io::Write
 /// Creates a `panicking` module which contains one function per GL command.
 ///
 /// These functions are the mocks that are called if the real function could not be loaded.
-fn write_panicking_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_panicking_fns<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     writeln!(dest,
-        "#[inline(never)]
+             "#[inline(never)]
         fn missing_fn_panic() -> ! {{
             panic!(\"{api} function was not loaded\")
         }}",
-        api = registry.api
-    )
+             api = registry.api)
 }
 
 /// Creates a structure which stores all the `FnPtr` of the bindings.
 ///
 /// The name of the struct corresponds to the namespace.
-fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
-    try!(writeln!(dest, "
+fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
+    try!(writeln!(dest,
+                  "
         #[allow(non_camel_case_types, non_snake_case, dead_code)]
         #[derive(Clone)]
         pub struct {api} {{",
-        api = super::gen_struct_name(registry.api)
-    ));
+                  api = super::gen_struct_name(registry.api)));
 
     for cmd in &registry.cmds {
         if let Some(v) = registry.aliases.get(&cmd.proto.ident) {
@@ -138,9 +154,11 @@ fn write_struct<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W:
 }
 
 /// Creates the `impl` of the structure created by `write_struct`.
-fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: io::Write {
+fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()>
+    where W: io::Write
+{
     try!(writeln!(dest,
-        "impl {api} {{
+                  "impl {api} {{
             /// Load each OpenGL symbol using a custom load function. This allows for the
             /// use of functions like `glfwGetProcAddress` or `SDL_GL_GetProcAddress`.
             ///
@@ -167,8 +185,7 @@ fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
                     do_metaloadfn(&mut loadfn, symbol, symbols)
                 }};
                 {api} {{",
-        api = super::gen_struct_name(registry.api)
-    ));
+                  api = super::gen_struct_name(registry.api)));
 
     for cmd in &registry.cmds {
         try!(writeln!(dest,
@@ -187,9 +204,8 @@ fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
     }
 
     try!(writeln!(dest,
-            "}}
-        }}"
-    ));
+                  "}}
+        }}"));
 
     for cmd in &registry.cmds {
         try!(writeln!(dest,
@@ -207,9 +223,8 @@ fn write_impl<W>(registry: &Registry, dest: &mut W) -> io::Result<()> where W: i
     }
 
     writeln!(dest,
-        "}}
+             "}}
 
         unsafe impl __gl_imports::Send for {api} {{}}",
-        api = super::gen_struct_name(registry.api)
-    )
+             api = super::gen_struct_name(registry.api))
 }
diff --git a/gl_generator/generators/templates/types/egl.rs b/gl_generator/generators/templates/types/egl.rs
index 82b4c718..e79ed2c2 100644
--- a/gl_generator/generators/templates/types/egl.rs
+++ b/gl_generator/generators/templates/types/egl.rs
@@ -1,19 +1,27 @@
 // platform-specific aliases are unknown
 // IMPORTANT: these are alises to the same level of the bindings
 // the values must be defined by the user
+#[allow(dead_code)]
 pub type khronos_utime_nanoseconds_t = super::khronos_utime_nanoseconds_t;
+#[allow(dead_code)]
 pub type khronos_uint64_t = super::khronos_uint64_t;
+#[allow(dead_code)]
 pub type khronos_ssize_t = super::khronos_ssize_t;
 pub type EGLNativeDisplayType = super::EGLNativeDisplayType;
+#[allow(dead_code)]
 pub type EGLNativePixmapType = super::EGLNativePixmapType;
+#[allow(dead_code)]
 pub type EGLNativeWindowType = super::EGLNativeWindowType;
 pub type EGLint = super::EGLint;
+#[allow(dead_code)]
 pub type NativeDisplayType = super::NativeDisplayType;
+#[allow(dead_code)]
 pub type NativePixmapType = super::NativePixmapType;
+#[allow(dead_code)]
 pub type NativeWindowType = super::NativeWindowType;
 
 // EGL alises
-pub type Bool = EGLBoolean;  // TODO: not sure
+pub type Bool = EGLBoolean; // TODO: not sure
 pub type EGLBoolean = super::__gl_imports::raw::c_uint;
 pub type EGLenum = super::__gl_imports::raw::c_uint;
 pub type EGLAttribKHR = isize;
@@ -40,8 +48,16 @@ pub type EGLStreamKHR = *const super::__gl_imports::raw::c_void;
 pub type EGLuint64KHR = khronos_uint64_t;
 pub type EGLNativeFileDescriptorKHR = super::__gl_imports::raw::c_int;
 pub type EGLsizeiANDROID = khronos_ssize_t;
-pub type EGLSetBlobFuncANDROID = extern "system" fn(*const super::__gl_imports::raw::c_void, EGLsizeiANDROID, *const super::__gl_imports::raw::c_void, EGLsizeiANDROID) -> ();
-pub type EGLGetBlobFuncANDROID = extern "system" fn(*const super::__gl_imports::raw::c_void, EGLsizeiANDROID, *mut super::__gl_imports::raw::c_void, EGLsizeiANDROID) -> EGLsizeiANDROID;
+pub type EGLSetBlobFuncANDROID = extern "system" fn(*const super::__gl_imports::raw::c_void,
+                                                    EGLsizeiANDROID,
+                                                    *const super::__gl_imports::raw::c_void,
+                                                    EGLsizeiANDROID)
+                                                    -> ();
+pub type EGLGetBlobFuncANDROID = extern "system" fn(*const super::__gl_imports::raw::c_void,
+                                                    EGLsizeiANDROID,
+                                                    *mut super::__gl_imports::raw::c_void,
+                                                    EGLsizeiANDROID)
+                                                    -> EGLsizeiANDROID;
 
 #[repr(C)]
 pub struct EGLClientPixmapHI {
diff --git a/gl_generator/generators/templates/types/gl.rs b/gl_generator/generators/templates/types/gl.rs
index c1d2dd90..5b7cb3ff 100644
--- a/gl_generator/generators/templates/types/gl.rs
+++ b/gl_generator/generators/templates/types/gl.rs
@@ -19,8 +19,10 @@ pub type GLeglImageOES = *const super::__gl_imports::raw::c_void;
 pub type GLchar = super::__gl_imports::raw::c_char;
 pub type GLcharARB = super::__gl_imports::raw::c_char;
 
-#[cfg(target_os = "macos")] pub type GLhandleARB = *const super::__gl_imports::raw::c_void;
-#[cfg(not(target_os = "macos"))] pub type GLhandleARB = super::__gl_imports::raw::c_uint;
+#[cfg(target_os = "macos")]
+pub type GLhandleARB = *const super::__gl_imports::raw::c_void;
+#[cfg(not(target_os = "macos"))]
+pub type GLhandleARB = super::__gl_imports::raw::c_uint;
 
 pub type GLhalfARB = super::__gl_imports::raw::c_ushort;
 pub type GLhalf = super::__gl_imports::raw::c_ushort;
@@ -40,13 +42,31 @@ pub type GLuint64EXT = u64;
 pub enum __GLsync {}
 pub type GLsync = *const __GLsync;
 
-    // compatible with OpenCL cl_context
+// compatible with OpenCL cl_context
 pub enum _cl_context {}
 pub enum _cl_event {}
 
-pub type GLDEBUGPROC = extern "system" fn(source: GLenum, gltype: GLenum, id: GLuint, severity: GLenum, length: GLsizei, message: *const GLchar, userParam: *mut super::__gl_imports::raw::c_void);
-pub type GLDEBUGPROCARB = extern "system" fn(source: GLenum, gltype: GLenum, id: GLuint, severity: GLenum, length: GLsizei, message: *const GLchar, userParam: *mut super::__gl_imports::raw::c_void);
-pub type GLDEBUGPROCKHR = extern "system" fn(source: GLenum, gltype: GLenum, id: GLuint, severity: GLenum, length: GLsizei, message: *const GLchar, userParam: *mut super::__gl_imports::raw::c_void);
+pub type GLDEBUGPROC = extern "system" fn(source: GLenum,
+                                          gltype: GLenum,
+                                          id: GLuint,
+                                          severity: GLenum,
+                                          length: GLsizei,
+                                          message: *const GLchar,
+                                          userParam: *mut super::__gl_imports::raw::c_void);
+pub type GLDEBUGPROCARB = extern "system" fn(source: GLenum,
+                                             gltype: GLenum,
+                                             id: GLuint,
+                                             severity: GLenum,
+                                             length: GLsizei,
+                                             message: *const GLchar,
+                                             userParam: *mut super::__gl_imports::raw::c_void);
+pub type GLDEBUGPROCKHR = extern "system" fn(source: GLenum,
+                                             gltype: GLenum,
+                                             id: GLuint,
+                                             severity: GLenum,
+                                             length: GLsizei,
+                                             message: *const GLchar,
+                                             userParam: *mut super::__gl_imports::raw::c_void);
 
 // GLES 1 types
 // "pub type GLclampx = i32;",
@@ -78,6 +98,11 @@ pub type GLDEBUGPROCKHR = extern "system" fn(source: GLenum, gltype: GLenum, id:
 // GLES 2 types (none currently)
 
 // Vendor extension types
-pub type GLDEBUGPROCAMD = extern "system" fn(id: GLuint, category: GLenum, severity: GLenum, length: GLsizei, message: *const GLchar, userParam: *mut super::__gl_imports::raw::c_void);
+pub type GLDEBUGPROCAMD = extern "system" fn(id: GLuint,
+                                             category: GLenum,
+                                             severity: GLenum,
+                                             length: GLsizei,
+                                             message: *const GLchar,
+                                             userParam: *mut super::__gl_imports::raw::c_void);
 pub type GLhalfNV = super::__gl_imports::raw::c_ushort;
 pub type GLvdpauSurfaceNV = GLintptr;
diff --git a/gl_generator/generators/templates/types/glx.rs b/gl_generator/generators/templates/types/glx.rs
index 23b5d03a..04737aca 100644
--- a/gl_generator/generators/templates/types/glx.rs
+++ b/gl_generator/generators/templates/types/glx.rs
@@ -39,28 +39,28 @@ pub struct XVisualInfo {
 
 #[repr(C)]
 pub struct GLXPbufferClobberEvent {
-    pub event_type: super::__gl_imports::raw::c_int,          // GLX_DAMAGED or GLX_SAVED
-    pub draw_type: super::__gl_imports::raw::c_int,           // GLX_WINDOW or GLX_PBUFFER
-    pub serial: super::__gl_imports::raw::c_ulong,            // # of last request processed by server
-    pub send_event: Bool,                                     // true if this came for SendEvent request
-    pub display: *const Display,                              // display the event was read from
-    pub drawable: GLXDrawable,                                // XID of Drawable
-    pub buffer_mask: super::__gl_imports::raw::c_uint,        // mask indicating which buffers are affected
-    pub aux_buffer: super::__gl_imports::raw::c_uint,         // which aux buffer was affected
+    pub event_type: super::__gl_imports::raw::c_int, // GLX_DAMAGED or GLX_SAVED
+    pub draw_type: super::__gl_imports::raw::c_int, // GLX_WINDOW or GLX_PBUFFER
+    pub serial: super::__gl_imports::raw::c_ulong, // # of last request processed by server
+    pub send_event: Bool, // true if this came for SendEvent request
+    pub display: *const Display, // display the event was read from
+    pub drawable: GLXDrawable, // XID of Drawable
+    pub buffer_mask: super::__gl_imports::raw::c_uint, // mask indicating which buffers are affected
+    pub aux_buffer: super::__gl_imports::raw::c_uint, // which aux buffer was affected
     pub x: super::__gl_imports::raw::c_int,
     pub y: super::__gl_imports::raw::c_int,
     pub width: super::__gl_imports::raw::c_int,
     pub height: super::__gl_imports::raw::c_int,
-    pub count: super::__gl_imports::raw::c_int,               // if nonzero, at least this many more
+    pub count: super::__gl_imports::raw::c_int, // if nonzero, at least this many more
 }
 
 #[repr(C)]
 pub struct GLXBufferSwapComplete {
     pub type_: super::__gl_imports::raw::c_int,
-    pub serial: super::__gl_imports::raw::c_ulong,            // # of last request processed by server
-    pub send_event: Bool,                                     // true if this came from a SendEvent request
-    pub display: *const Display,                              // Display the event was read from
-    pub drawable: GLXDrawable,                                // drawable on which event was requested in event mask
+    pub serial: super::__gl_imports::raw::c_ulong, // # of last request processed by server
+    pub send_event: Bool, // true if this came from a SendEvent request
+    pub display: *const Display, // Display the event was read from
+    pub drawable: GLXDrawable, // drawable on which event was requested in event mask
     pub event_type: super::__gl_imports::raw::c_int,
     pub ust: i64,
     pub msc: i64,
@@ -76,29 +76,29 @@ pub struct GLXBufferSwapComplete {
 #[repr(C)]
 pub struct GLXBufferClobberEventSGIX {
     pub type_: super::__gl_imports::raw::c_int,
-    pub serial: super::__gl_imports::raw::c_ulong,            // # of last request processed by server
-    pub send_event: Bool,                                     // true if this came for SendEvent request
-    pub display: *const Display,                              // display the event was read from
-    pub drawable: GLXDrawable,                                // i.d. of Drawable
-    pub event_type: super::__gl_imports::raw::c_int,          // GLX_DAMAGED_SGIX or GLX_SAVED_SGIX
-    pub draw_type: super::__gl_imports::raw::c_int,           // GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX
-    pub mask: super::__gl_imports::raw::c_uint,               // mask indicating which buffers are affected
+    pub serial: super::__gl_imports::raw::c_ulong, // # of last request processed by server
+    pub send_event: Bool, // true if this came for SendEvent request
+    pub display: *const Display, // display the event was read from
+    pub drawable: GLXDrawable, // i.d. of Drawable
+    pub event_type: super::__gl_imports::raw::c_int, // GLX_DAMAGED_SGIX or GLX_SAVED_SGIX
+    pub draw_type: super::__gl_imports::raw::c_int, // GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX
+    pub mask: super::__gl_imports::raw::c_uint, // mask indicating which buffers are affected
     pub x: super::__gl_imports::raw::c_int,
     pub y: super::__gl_imports::raw::c_int,
     pub width: super::__gl_imports::raw::c_int,
     pub height: super::__gl_imports::raw::c_int,
-    pub count: super::__gl_imports::raw::c_int,               // if nonzero, at least this many more
+    pub count: super::__gl_imports::raw::c_int, // if nonzero, at least this many more
 }
 
 #[repr(C)]
 pub struct GLXHyperpipeNetworkSGIX {
-    pub pipeName: [super::__gl_imports::raw::c_char; 80],   // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
+    pub pipeName: [super::__gl_imports::raw::c_char; 80], // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
     pub networkId: super::__gl_imports::raw::c_int,
 }
 
 #[repr(C)]
 pub struct GLXHyperpipeConfigSGIX {
-    pub pipeName: [super::__gl_imports::raw::c_char; 80],   // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
+    pub pipeName: [super::__gl_imports::raw::c_char; 80], // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
     pub channel: super::__gl_imports::raw::c_int,
     pub participationType: super::__gl_imports::raw::c_uint,
     pub timeSlice: super::__gl_imports::raw::c_int,
@@ -106,7 +106,7 @@ pub struct GLXHyperpipeConfigSGIX {
 
 #[repr(C)]
 pub struct GLXPipeRect {
-    pub pipeName: [super::__gl_imports::raw::c_char; 80],   // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
+    pub pipeName: [super::__gl_imports::raw::c_char; 80], // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
     pub srcXOrigin: super::__gl_imports::raw::c_int,
     pub srcYOrigin: super::__gl_imports::raw::c_int,
     pub srcWidth: super::__gl_imports::raw::c_int,
@@ -119,7 +119,7 @@ pub struct GLXPipeRect {
 
 #[repr(C)]
 pub struct GLXPipeRectLimits {
-    pub pipeName: [super::__gl_imports::raw::c_char; 80],   // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
+    pub pipeName: [super::__gl_imports::raw::c_char; 80], // Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]
     pub XOrigin: super::__gl_imports::raw::c_int,
     pub YOrigin: super::__gl_imports::raw::c_int,
     pub maxHeight: super::__gl_imports::raw::c_int,
diff --git a/gl_generator/generators/templates/types/wgl.rs b/gl_generator/generators/templates/types/wgl.rs
index c2d19390..0e7cc61f 100644
--- a/gl_generator/generators/templates/types/wgl.rs
+++ b/gl_generator/generators/templates/types/wgl.rs
@@ -26,7 +26,7 @@ pub type HGLRC = *const super::__gl_imports::raw::c_void;
 pub type INT = super::__gl_imports::raw::c_int;
 pub type PVOID = *const super::__gl_imports::raw::c_void;
 pub type LPVOID = *const super::__gl_imports::raw::c_void;
-pub type PROC = extern "system" fn();     // Not sure about this one :/
+pub type PROC = extern "system" fn(); // Not sure about this one :/
 
 #[repr(C)]
 pub struct RECT {
diff --git a/gl_generator/registry/mod.rs b/gl_generator/registry/mod.rs
index 764f2502..221cd16e 100644
--- a/gl_generator/registry/mod.rs
+++ b/gl_generator/registry/mod.rs
@@ -26,12 +26,20 @@ use Generator;
 mod parse;
 
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
-pub enum Api { Gl, Glx, Wgl, Egl, GlCore, Gles1, Gles2 }
+pub enum Api {
+    Gl,
+    Glx,
+    Wgl,
+    Egl,
+    GlCore,
+    Gles1,
+    Gles2,
+}
 
 impl fmt::Display for Api {
     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
         match *self {
-            Api::Gl  => write!(fmt, "gl"),
+            Api::Gl => write!(fmt, "gl"),
             Api::Glx => write!(fmt, "glx"),
             Api::Wgl => write!(fmt, "wgl"),
             Api::Egl => write!(fmt, "egl"),
@@ -43,10 +51,16 @@ impl fmt::Display for Api {
 }
 
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
-pub enum Fallbacks { All, None }
+pub enum Fallbacks {
+    All,
+    None,
+}
 
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
-pub enum Profile { Core, Compatibility }
+pub enum Profile {
+    Core,
+    Compatibility,
+}
 
 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
 pub struct Enum {
@@ -99,11 +113,18 @@ pub struct Registry {
 }
 
 impl Registry {
-    pub fn new<'a, Exts>(api: Api, version: (u8, u8), profile: Profile, fallbacks: Fallbacks, extensions: Exts) -> Registry where
-        Exts: AsRef<[&'a str]>,
+    pub fn new<'a, Exts>(api: Api,
+                         version: (u8, u8),
+                         profile: Profile,
+                         fallbacks: Fallbacks,
+                         extensions: Exts)
+                         -> Registry
+        where Exts: AsRef<[&'a str]>
     {
         let (major, minor) = version;
-        let extensions = extensions.as_ref().iter()
+        let extensions = extensions
+            .as_ref()
+            .iter()
             .map(<&str>::to_string)
             .collect();
 
@@ -125,9 +146,9 @@ impl Registry {
         parse::from_xml(src, filter)
     }
 
-    pub fn write_bindings<W, G>(&self, generator: G, output: &mut W) -> io::Result<()> where
-        G: Generator,
-        W: io::Write,
+    pub fn write_bindings<W, G>(&self, generator: G, output: &mut W) -> io::Result<()>
+        where G: Generator,
+              W: io::Write
     {
         generator.write(&self, output)
     }
diff --git a/gl_generator/registry/parse.rs b/gl_generator/registry/parse.rs
index 4db77b11..dc5b2cdb 100644
--- a/gl_generator/registry/parse.rs
+++ b/gl_generator/registry/parse.rs
@@ -26,7 +26,8 @@ use {Fallbacks, Api, Profile};
 use registry::{Binding, Cmd, Enum, GlxOpcode, Registry};
 
 pub fn from_xml<R: io::Read>(src: R, filter: Filter) -> Registry {
-    XmlEventReader::new(src).into_iter()
+    XmlEventReader::new(src)
+        .into_iter()
         .map(Result::unwrap)
         .filter_map(ParseEvent::from_xml)
         .parse(filter)
@@ -39,9 +40,9 @@ struct Attribute {
 }
 
 impl Attribute {
-    fn new<Key, Value>(key: Key, value: Value) -> Attribute where
-        Key: ToString,
-        Value: ToString,
+    fn new<Key, Value>(key: Key, value: Value) -> Attribute
+        where Key: ToString,
+              Value: ToString
     {
         Attribute {
             key: key.to_string(),
@@ -69,11 +70,9 @@ impl ParseEvent {
             XmlEvent::StartDocument { .. } => None,
             XmlEvent::EndDocument => None,
             XmlEvent::StartElement { name, attributes, .. } => {
-                let attributes = attributes.into_iter()
-                    .map(Attribute::from)
-                    .collect();
+                let attributes = attributes.into_iter().map(Attribute::from).collect();
                 Some(ParseEvent::Start(name.local_name, attributes))
-            },
+            }
             XmlEvent::EndElement { name } => Some(ParseEvent::End(name.local_name)),
             XmlEvent::Characters(chars) => Some(ParseEvent::Text(chars)),
             XmlEvent::ProcessingInstruction { .. } => None,
@@ -93,7 +92,7 @@ fn api_from_str(src: &str) -> Result<Api, ()> {
         "glcore" => Ok(Api::GlCore),
         "gles1" => Ok(Api::Gles1),
         "gles2" => Ok(Api::Gles2),
-        _     => Err(()),
+        _ => Err(()),
     }
 }
 
@@ -122,15 +121,19 @@ fn underscore_keyword(ident: String) -> String {
 }
 
 fn trim_str<'a>(s: &'a str, trim: &str) -> &'a str {
-    if s.starts_with(trim) { &s[trim.len()..] } else { s }
+    if s.starts_with(trim) {
+        &s[trim.len()..]
+    } else {
+        s
+    }
 }
 
 fn trim_enum_prefix(ident: &str, api: Api) -> String {
     let ident = match api {
         Api::Gl | Api::GlCore | Api::Gles1 | Api::Gles2 => trim_str(ident, "GL_"),
         Api::Glx => trim_str(ident, "GLX_"),
-        Api::Wgl =>  trim_str(ident, "WGL_"),
-        Api::Egl =>  trim_str(ident, "EGL_"),
+        Api::Wgl => trim_str(ident, "WGL_"),
+        Api::Egl => trim_str(ident, "EGL_"),
     };
     underscore_numeric_prefix(ident)
 }
@@ -142,10 +145,10 @@ fn make_enum(ident: String, ty: Option<String>, value: String, alias: Option<Str
 
             // nothing to see here....
             // just brute forcing some paren matching... (ﾉ ◕ ◡ ◕)ﾉ *:･ﾟ✧
-            let working = &value[2 .. value.len() - 1];
+            let working = &value[2..value.len() - 1];
             if let Some((i, _)) = working.match_indices(")").next() {
-                let ty = working[.. i].to_string();
-                let value = working[i + 1 ..].to_string();
+                let ty = working[..i].to_string();
+                let value = working[i + 1..].to_string();
 
                 (Cow::Owned(ty), value, true)
             } else {
@@ -177,16 +180,20 @@ fn trim_cmd_prefix(ident: &str, api: Api) -> &str {
     match api {
         Api::Gl | Api::GlCore | Api::Gles1 | Api::Gles2 => trim_str(ident, "gl"),
         Api::Glx => trim_str(ident, "glX"),
-        Api::Wgl =>  trim_str(ident, "wgl"),
-        Api::Egl =>  trim_str(ident, "egl"),
+        Api::Wgl => trim_str(ident, "wgl"),
+        Api::Egl => trim_str(ident, "egl"),
     }
 }
 
 fn merge_map(a: &mut BTreeMap<String, Vec<String>>, b: BTreeMap<String, Vec<String>>) {
     for (k, v) in b {
         match a.entry(k) {
-            Entry::Occupied(mut ent) => { ent.get_mut().extend(v); },
-            Entry::Vacant(ent) => { ent.insert(v); }
+            Entry::Occupied(mut ent) => {
+                ent.get_mut().extend(v);
+            }
+            Entry::Vacant(ent) => {
+                ent.insert(v);
+            }
         }
     }
 }
@@ -327,7 +334,9 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
         for extension in &extensions {
             if filter.extensions.contains(&extension.name) {
                 if !extension.supported.contains(&filter.api) {
-                    panic!("Requested {}, which doesn't support the {} API", extension.name, filter.api);
+                    panic!("Requested {}, which doesn't support the {} API",
+                           extension.name,
+                           filter.api);
                 }
                 for require in &extension.requires {
                     desired_enums.extend(require.enums.iter().map(|x| x.clone()));
@@ -354,7 +363,11 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
             api: filter.api,
             enums: enums.into_iter().filter(is_desired_enum).collect(),
             cmds: cmds.into_iter().filter(is_desired_cmd).collect(),
-            aliases: if filter.fallbacks == Fallbacks::None { BTreeMap::new() } else { aliases },
+            aliases: if filter.fallbacks == Fallbacks::None {
+                BTreeMap::new()
+            } else {
+                aliases
+            },
         }
     }
 
@@ -368,7 +381,9 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
     fn consume_start_element(&mut self, expected_name: &str) -> Vec<Attribute> {
         match self.next().unwrap() {
             ParseEvent::Start(name, attributes) => {
-                if expected_name == name { attributes } else {
+                if expected_name == name {
+                    attributes
+                } else {
                     panic!("Expected <{}>, found: <{}>", expected_name, name)
                 }
             }
@@ -387,12 +402,16 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
         loop {
             match self.next().unwrap() {
                 ParseEvent::End(ref name) if expected_name == name => break,
-                _ => {},
+                _ => {}
             }
         }
     }
 
-    fn consume_two<'a, T: FromXml, U: FromXml>(&mut self, one: &'a str, two: &'a str, end: &'a str) -> (Vec<T>, Vec<U>) {
+    fn consume_two<'a, T: FromXml, U: FromXml>(&mut self,
+                                               one: &'a str,
+                                               two: &'a str,
+                                               end: &'a str)
+                                               -> (Vec<T>, Vec<U>) {
         debug!("consume_two: looking for {} and {} until {}", one, two, end);
 
         let mut ones = Vec::new();
@@ -419,7 +438,7 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
                     } else {
                         panic!("Unexpected element: <{:?} {:?}>", n, &attributes);
                     }
-                },
+                }
                 ParseEvent::End(ref name) => {
                     debug!("Found end element </{:?}>", name);
 
@@ -436,8 +455,9 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
                     } else {
                         panic!("Unexpected end element {:?}", name);
                     }
-                },
-                event => panic!("Unexpected message {:?}", event) }
+                }
+                event => panic!("Unexpected message {:?}", event),
+            }
         }
     }
 
@@ -446,13 +466,13 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
         loop {
             match self.next().unwrap() {
                 // ignores
-                ParseEvent::Text(_) => {},
+                ParseEvent::Text(_) => {}
                 ParseEvent::Start(ref name, _) if name == "unused" => self.skip_to_end("unused"),
 
                 // add enum definition
                 ParseEvent::Start(ref name, ref attributes) if name == "enum" => {
                     enums.push(self.consume_enum(api, attributes));
-                },
+                }
 
                 // finished building the namespace
                 ParseEvent::End(ref name) if name == "enums" => break,
@@ -483,8 +503,12 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
                     let new = self.consume_cmd(api);
                     if let Some(ref v) = new.alias {
                         match aliases.entry(v.clone()) {
-                            Entry::Occupied(mut ent) => { ent.get_mut().push(new.proto.ident.clone()); },
-                            Entry::Vacant(ent) => { ent.insert(vec![new.proto.ident.clone()]); }
+                            Entry::Occupied(mut ent) => {
+                                ent.get_mut().push(new.proto.ident.clone());
+                            }
+                            Entry::Vacant(ent) => {
+                                ent.insert(vec![new.proto.ident.clone()]);
+                            }
                         }
                     }
                     cmds.push(new);
@@ -524,9 +548,9 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
                 }
                 ParseEvent::Start(ref name, ref attributes) if name == "glx" => {
                     glx = Some(GlxOpcode {
-                        opcode: get_attribute(&attributes, "opcode").unwrap(),
-                        name: get_attribute(&attributes, "name"),
-                    });
+                                   opcode: get_attribute(&attributes, "opcode").unwrap(),
+                                   name: get_attribute(&attributes, "name"),
+                               });
                     self.consume_end_element("glx");
                 }
                 ParseEvent::End(ref name) if name == "command" => break,
@@ -576,12 +600,11 @@ trait Parse: Sized + Iterator<Item = ParseEvent> {
     }
 }
 
-impl<T> Parse for T where
-    T: Sized + Iterator<Item = ParseEvent>,
-{}
+impl<T> Parse for T where T: Sized + Iterator<Item = ParseEvent> {}
 
 fn get_attribute(attribs: &[Attribute], key: &str) -> Option<String> {
-    attribs.iter()
+    attribs
+        .iter()
         .find(|attrib| attrib.key == key)
         .map(|attrib| attrib.value.clone())
 }
@@ -596,7 +619,7 @@ impl FromXml for Require {
         let (enums, commands) = parser.consume_two("enum", "command", "require");
         Require {
             enums: enums,
-            commands: commands
+            commands: commands,
         }
     }
 }
@@ -611,7 +634,7 @@ impl FromXml for Remove {
         Remove {
             profile: profile,
             enums: enums,
-            commands: commands
+            commands: commands,
         }
     }
 }
@@ -633,7 +656,7 @@ impl FromXml for Feature {
             name: name,
             number: number,
             requires: require,
-            removes: remove
+            removes: remove,
         }
     }
 }
@@ -642,7 +665,8 @@ impl FromXml for Extension {
     fn convert<P: Parse>(parser: &mut P, a: &[Attribute]) -> Extension {
         debug!("Doing a FromXml on Extension");
         let name = get_attribute(a, "name").unwrap();
-        let supported = get_attribute(a, "supported").unwrap()
+        let supported = get_attribute(a, "supported")
+            .unwrap()
             .split('|')
             .map(api_from_str)
             .map(Result::unwrap)
@@ -654,14 +678,14 @@ impl FromXml for Extension {
                     require.push(FromXml::convert(parser, &attributes));
                 }
                 ParseEvent::End(ref name) if name == "extension" => break,
-                event => panic!("Unexpected message {:?}", event)
+                event => panic!("Unexpected message {:?}", event),
             }
         }
 
         Extension {
             name: name,
             supported: supported,
-            requires: require
+            requires: require,
         }
     }
 }
@@ -676,162 +700,162 @@ impl FromXml for String {
 pub fn to_rust_ty<T: AsRef<str>>(ty: T) -> Cow<'static, str> {
     let ty = match ty.as_ref() {
         // gl.xml types
-        "GLDEBUGPROC"               => "types::GLDEBUGPROC",
-        "GLDEBUGPROCAMD"            => "types::GLDEBUGPROCAMD",
-        "GLDEBUGPROCARB"            => "types::GLDEBUGPROCARB",
-        "GLDEBUGPROCKHR"            => "types::GLDEBUGPROCKHR",
-        "GLbitfield"                => "types::GLbitfield",
-        "GLboolean"                 => "types::GLboolean",
-        "GLbyte"                    => "types::GLbyte",
-        "GLclampd"                  => "types::GLclampd",
-        "GLclampf"                  => "types::GLclampf",
-        "GLclampx"                  => "types::GLclampx",
-        "GLdouble"                  => "types::GLdouble",
-        "GLeglImageOES"             => "types::GLeglImageOES",
-        "GLenum"                    => "types::GLenum",
-        "GLfixed"                   => "types::GLfixed",
-        "GLfloat"                   => "types::GLfloat",
-        "GLhalfNV"                  => "types::GLhalfNV",
-        "GLhandleARB"               => "types::GLhandleARB",
-        "GLint"                     => "types::GLint",
-        "GLint64"                   => "types::GLint64",
-        "GLint64EXT"                => "types::GLint64EXT",
-        "GLintptr"                  => "types::GLintptr",
-        "GLintptrARB"               => "types::GLintptrARB",
-        "GLshort"                   => "types::GLshort",
-        "GLsizei"                   => "types::GLsizei",
-        "GLsizeiptr"                => "types::GLsizeiptr",
-        "GLsizeiptrARB"             => "types::GLsizeiptrARB",
-        "GLsync"                    => "types::GLsync",
-        "GLubyte"                   => "types::GLubyte",
-        "GLuint"                    => "types::GLuint",
-        "GLuint64"                  => "types::GLuint64",
-        "GLuint64EXT"               => "types::GLuint64EXT",
-        "GLushort"                  => "types::GLushort",
-        "GLvdpauSurfaceNV"          => "types::GLvdpauSurfaceNV",
-        "void "                     => "()",
-        "GLboolean *"               => "*mut types::GLboolean",
-        "GLchar *"                  => "*mut types::GLchar",
-        "GLcharARB *"               => "*mut types::GLcharARB",
-        "GLdouble *"                => "*mut types::GLdouble",
-        "GLenum *"                  => "*mut types::GLenum",
-        "GLfixed *"                 => "*mut types::GLfixed",
-        "GLfloat *"                 => "*mut types::GLfloat",
-        "GLhandleARB *"             => "*mut types::GLhandleARB",
-        "GLint *"                   => "*mut types::GLint",
-        "GLint64 *"                 => "*mut types::GLint64",
-        "GLint64EXT *"              => "*mut types::GLint64EXT",
-        "GLsizei *"                 => "*mut types::GLsizei",
-        "GLubyte *"                 => "*mut types::GLubyte",
-        "GLuint *"                  => "*mut types::GLuint",
-        "GLuint [2]"                => "*mut [types::GLuint; 2]",
-        "GLuint64 *"                => "*mut types::GLuint64",
-        "GLuint64EXT *"             => "*mut types::GLuint64EXT",
-        "GLushort *"                => "*mut types::GLushort",
-        "GLvoid *"                  => "*mut types::GLvoid",
-        "GLvoid **"                 => "*const *mut types::GLvoid",
-        "void *"                    => "*mut __gl_imports::raw::c_void",
-        "void **"                   => "*const *mut __gl_imports::raw::c_void",
-        "const GLboolean *"         => "*const types::GLboolean",
-        "const GLbyte *"            => "*const types::GLbyte",
-        "const GLchar *"            => "*const types::GLchar",
-        "const GLcharARB *"         => "*const types::GLcharARB",
-        "const GLclampf *"          => "*const types::GLclampf",
-        "const GLdouble *"          => "*const types::GLdouble",
-        "const GLenum *"            => "*const types::GLenum",
-        "const GLfixed *"           => "*const types::GLfixed",
-        "const GLfloat"             => "types::GLfloat",
-        "const GLfloat *"           => "*const types::GLfloat",
-        "const GLhalfNV *"          => "*const types::GLhalfNV",
-        "const GLint *"             => "*const types::GLint",
-        "const GLint64 *"           => "*const types::GLint64",
-        "const GLint64EXT *"        => "*const types::GLint64EXT",
-        "const GLintptr *"          => "*const types::GLintptr",
-        "const GLshort *"           => "*const types::GLshort",
-        "const GLsizei *"           => "*const types::GLsizei",
-        "const GLsizeiptr *"        => "*const types::GLsizeiptr",
-        "const GLubyte *"           => "*const types::GLubyte",
-        "const GLuint *"            => "*const types::GLuint",
-        "const GLuint64 *"          => "*const types::GLuint64",
-        "const GLuint64EXT *"       => "*const types::GLuint64EXT",
-        "const GLushort *"          => "*const types::GLushort",
-        "const GLvdpauSurfaceNV *"  => "*const types::GLvdpauSurfaceNV",
-        "const GLvoid *"            => "*const types::GLvoid",
-        "const void *"              => "*const __gl_imports::raw::c_void",
-        "const void **"             => "*const *const __gl_imports::raw::c_void",
-        "const void *const*"        => "*const *const __gl_imports::raw::c_void",
-        "const GLboolean **"        => "*const *const types::GLboolean",
-        "const GLchar **"           => "*const *const types::GLchar",
-        "const GLcharARB **"        => "*const *const types::GLcharARB",
-        "const GLvoid **"           => "*const *const types::GLvoid",
-        "const GLchar *const*"      => "*const *const types::GLchar",
-        "const GLvoid *const*"      => "*const *const types::GLvoid",
-        "struct _cl_context *"      => "*const types::_cl_context",
-        "struct _cl_event *"        => "*const types::_cl_event",
-        "GLuint[2]"                 => "[Gluint; 2]",
+        "GLDEBUGPROC" => "types::GLDEBUGPROC",
+        "GLDEBUGPROCAMD" => "types::GLDEBUGPROCAMD",
+        "GLDEBUGPROCARB" => "types::GLDEBUGPROCARB",
+        "GLDEBUGPROCKHR" => "types::GLDEBUGPROCKHR",
+        "GLbitfield" => "types::GLbitfield",
+        "GLboolean" => "types::GLboolean",
+        "GLbyte" => "types::GLbyte",
+        "GLclampd" => "types::GLclampd",
+        "GLclampf" => "types::GLclampf",
+        "GLclampx" => "types::GLclampx",
+        "GLdouble" => "types::GLdouble",
+        "GLeglImageOES" => "types::GLeglImageOES",
+        "GLenum" => "types::GLenum",
+        "GLfixed" => "types::GLfixed",
+        "GLfloat" => "types::GLfloat",
+        "GLhalfNV" => "types::GLhalfNV",
+        "GLhandleARB" => "types::GLhandleARB",
+        "GLint" => "types::GLint",
+        "GLint64" => "types::GLint64",
+        "GLint64EXT" => "types::GLint64EXT",
+        "GLintptr" => "types::GLintptr",
+        "GLintptrARB" => "types::GLintptrARB",
+        "GLshort" => "types::GLshort",
+        "GLsizei" => "types::GLsizei",
+        "GLsizeiptr" => "types::GLsizeiptr",
+        "GLsizeiptrARB" => "types::GLsizeiptrARB",
+        "GLsync" => "types::GLsync",
+        "GLubyte" => "types::GLubyte",
+        "GLuint" => "types::GLuint",
+        "GLuint64" => "types::GLuint64",
+        "GLuint64EXT" => "types::GLuint64EXT",
+        "GLushort" => "types::GLushort",
+        "GLvdpauSurfaceNV" => "types::GLvdpauSurfaceNV",
+        "void " => "()",
+        "GLboolean *" => "*mut types::GLboolean",
+        "GLchar *" => "*mut types::GLchar",
+        "GLcharARB *" => "*mut types::GLcharARB",
+        "GLdouble *" => "*mut types::GLdouble",
+        "GLenum *" => "*mut types::GLenum",
+        "GLfixed *" => "*mut types::GLfixed",
+        "GLfloat *" => "*mut types::GLfloat",
+        "GLhandleARB *" => "*mut types::GLhandleARB",
+        "GLint *" => "*mut types::GLint",
+        "GLint64 *" => "*mut types::GLint64",
+        "GLint64EXT *" => "*mut types::GLint64EXT",
+        "GLsizei *" => "*mut types::GLsizei",
+        "GLubyte *" => "*mut types::GLubyte",
+        "GLuint *" => "*mut types::GLuint",
+        "GLuint [2]" => "*mut [types::GLuint; 2]",
+        "GLuint64 *" => "*mut types::GLuint64",
+        "GLuint64EXT *" => "*mut types::GLuint64EXT",
+        "GLushort *" => "*mut types::GLushort",
+        "GLvoid *" => "*mut types::GLvoid",
+        "GLvoid **" => "*const *mut types::GLvoid",
+        "void *" => "*mut __gl_imports::raw::c_void",
+        "void **" => "*const *mut __gl_imports::raw::c_void",
+        "const GLboolean *" => "*const types::GLboolean",
+        "const GLbyte *" => "*const types::GLbyte",
+        "const GLchar *" => "*const types::GLchar",
+        "const GLcharARB *" => "*const types::GLcharARB",
+        "const GLclampf *" => "*const types::GLclampf",
+        "const GLdouble *" => "*const types::GLdouble",
+        "const GLenum *" => "*const types::GLenum",
+        "const GLfixed *" => "*const types::GLfixed",
+        "const GLfloat" => "types::GLfloat",
+        "const GLfloat *" => "*const types::GLfloat",
+        "const GLhalfNV *" => "*const types::GLhalfNV",
+        "const GLint *" => "*const types::GLint",
+        "const GLint64 *" => "*const types::GLint64",
+        "const GLint64EXT *" => "*const types::GLint64EXT",
+        "const GLintptr *" => "*const types::GLintptr",
+        "const GLshort *" => "*const types::GLshort",
+        "const GLsizei *" => "*const types::GLsizei",
+        "const GLsizeiptr *" => "*const types::GLsizeiptr",
+        "const GLubyte *" => "*const types::GLubyte",
+        "const GLuint *" => "*const types::GLuint",
+        "const GLuint64 *" => "*const types::GLuint64",
+        "const GLuint64EXT *" => "*const types::GLuint64EXT",
+        "const GLushort *" => "*const types::GLushort",
+        "const GLvdpauSurfaceNV *" => "*const types::GLvdpauSurfaceNV",
+        "const GLvoid *" => "*const types::GLvoid",
+        "const void *" => "*const __gl_imports::raw::c_void",
+        "const void **" => "*const *const __gl_imports::raw::c_void",
+        "const void *const*" => "*const *const __gl_imports::raw::c_void",
+        "const GLboolean **" => "*const *const types::GLboolean",
+        "const GLchar **" => "*const *const types::GLchar",
+        "const GLcharARB **" => "*const *const types::GLcharARB",
+        "const GLvoid **" => "*const *const types::GLvoid",
+        "const GLchar *const*" => "*const *const types::GLchar",
+        "const GLvoid *const*" => "*const *const types::GLvoid",
+        "struct _cl_context *" => "*const types::_cl_context",
+        "struct _cl_event *" => "*const types::_cl_event",
+        "GLuint[2]" => "[Gluint; 2]",
 
         // glx.xml types
-        "Bool"                      => "types::Bool",
-        "Colormap"                  => "types::Colormap",
-        "DMbuffer"                  => "types::DMbuffer",
-        "Font"                      => "types::Font",
-        "GLXContext"                => "types::GLXContext",
-        "GLXContextID"              => "types::GLXContextID",
-        "GLXDrawable"               => "types::GLXDrawable",
-        "GLXFBConfig"               => "types::GLXFBConfig",
-        "GLXFBConfigSGIX"           => "types::GLXFBConfigSGIX",
-        "GLXPbuffer"                => "types::GLXPbuffer",
-        "GLXPbufferSGIX"            => "types::GLXPbufferSGIX",
-        "GLXPixmap"                 => "types::GLXPixmap",
-        "GLXVideoCaptureDeviceNV"   => "types::GLXVideoCaptureDeviceNV",
-        "GLXVideoDeviceNV"          => "types::GLXVideoDeviceNV",
-        "GLXVideoSourceSGIX"        => "types::GLXVideoSourceSGIX",
-        "GLXWindow"                 => "types::GLXWindow",
+        "Bool" => "types::Bool",
+        "Colormap" => "types::Colormap",
+        "DMbuffer" => "types::DMbuffer",
+        "Font" => "types::Font",
+        "GLXContext" => "types::GLXContext",
+        "GLXContextID" => "types::GLXContextID",
+        "GLXDrawable" => "types::GLXDrawable",
+        "GLXFBConfig" => "types::GLXFBConfig",
+        "GLXFBConfigSGIX" => "types::GLXFBConfigSGIX",
+        "GLXPbuffer" => "types::GLXPbuffer",
+        "GLXPbufferSGIX" => "types::GLXPbufferSGIX",
+        "GLXPixmap" => "types::GLXPixmap",
+        "GLXVideoCaptureDeviceNV" => "types::GLXVideoCaptureDeviceNV",
+        "GLXVideoDeviceNV" => "types::GLXVideoDeviceNV",
+        "GLXVideoSourceSGIX" => "types::GLXVideoSourceSGIX",
+        "GLXWindow" => "types::GLXWindow",
         // "GLboolean"                 => "types::GLboolean",
         // "GLenum"                    => "types::GLenum",
         // "GLint"                     => "types::GLint",
         // "GLsizei"                   => "types::GLsizei",
         // "GLuint"                    => "types::GLuint",
-        "Pixmap"                    => "types::Pixmap",
-        "Status"                    => "types::Status",
-        "VLNode"                    => "types::VLNode",
-        "VLPath"                    => "types::VLPath",
-        "VLServer"                  => "types::VLServer",
-        "Window"                    => "types::Window",
-        "__GLXextFuncPtr"           => "types::__GLXextFuncPtr",
-        "const GLXContext"          => "const types::GLXContext",
-        "float "                    => "__gl_imports::raw::c_float",
-        "int "                      => "__gl_imports::raw::c_int",
-        "int64_t"                   => "i64",
-        "unsigned int "             => "__gl_imports::raw::c_uint",
-        "unsigned long "            => "__gl_imports::raw::c_ulong",
+        "Pixmap" => "types::Pixmap",
+        "Status" => "types::Status",
+        "VLNode" => "types::VLNode",
+        "VLPath" => "types::VLPath",
+        "VLServer" => "types::VLServer",
+        "Window" => "types::Window",
+        "__GLXextFuncPtr" => "types::__GLXextFuncPtr",
+        "const GLXContext" => "const types::GLXContext",
+        "float " => "__gl_imports::raw::c_float",
+        "int " => "__gl_imports::raw::c_int",
+        "int64_t" => "i64",
+        "unsigned int " => "__gl_imports::raw::c_uint",
+        "unsigned long " => "__gl_imports::raw::c_ulong",
         // "void "                     => "()",
-        "DMparams *"                => "*mut types::DMparams",
-        "Display *"                 => "*mut types::Display",
-        "GLXFBConfig *"             => "*mut types::GLXFBConfig",
-        "GLXFBConfigSGIX *"         => "*mut types::GLXFBConfigSGIX",
-        "GLXHyperpipeConfigSGIX *"  => "*mut types::GLXHyperpipeConfigSGIX",
+        "DMparams *" => "*mut types::DMparams",
+        "Display *" => "*mut types::Display",
+        "GLXFBConfig *" => "*mut types::GLXFBConfig",
+        "GLXFBConfigSGIX *" => "*mut types::GLXFBConfigSGIX",
+        "GLXHyperpipeConfigSGIX *" => "*mut types::GLXHyperpipeConfigSGIX",
         "GLXHyperpipeNetworkSGIX *" => "*mut types::GLXHyperpipeNetworkSGIX",
         "GLXVideoCaptureDeviceNV *" => "*mut types::GLXVideoCaptureDeviceNV",
-        "GLXVideoDeviceNV *"        => "*mut types::GLXVideoDeviceNV",
+        "GLXVideoDeviceNV *" => "*mut types::GLXVideoDeviceNV",
         // "GLuint *"                  => "*mut types::GLuint",
-        "XVisualInfo *"             => "*mut types::XVisualInfo",
+        "XVisualInfo *" => "*mut types::XVisualInfo",
         // "const GLubyte *"           => "*GLubyte",
-        "const char *"              => "*const __gl_imports::raw::c_char",
-        "const int *"               => "*const __gl_imports::raw::c_int",
+        "const char *" => "*const __gl_imports::raw::c_char",
+        "const int *" => "*const __gl_imports::raw::c_int",
         // "const void *"              => "*const __gl_imports::raw::c_void",
-        "int *"                     => "*mut __gl_imports::raw::c_int",
-        "int32_t *"                 => "*mut i32",
-        "int64_t *"                 => "*mut i64",
-        "long *"                    => "*mut __gl_imports::raw::c_long",
-        "unsigned int *"            => "*mut __gl_imports::raw::c_uint",
-        "unsigned long *"           => "*mut __gl_imports::raw::c_ulong",
+        "int *" => "*mut __gl_imports::raw::c_int",
+        "int32_t *" => "*mut i32",
+        "int64_t *" => "*mut i64",
+        "long *" => "*mut __gl_imports::raw::c_long",
+        "unsigned int *" => "*mut __gl_imports::raw::c_uint",
+        "unsigned long *" => "*mut __gl_imports::raw::c_ulong",
         // "void *"                    => "*mut __gl_imports::raw::c_void",
 
         // wgl.xml types
-        "BOOL"                      => "types::BOOL",
-        "DWORD"                     => "types::DWORD",
-        "FLOAT"                     => "types::FLOAT",
+        "BOOL" => "types::BOOL",
+        "DWORD" => "types::DWORD",
+        "FLOAT" => "types::FLOAT",
         // "GLbitfield"                => "types::GLbitfield",
         // "GLboolean"                 => "types::GLboolean",
         // "GLenum"                    => "types::GLenum",
@@ -840,116 +864,116 @@ pub fn to_rust_ty<T: AsRef<str>>(ty: T) -> Cow<'static, str> {
         // "GLsizei"                   => "types::GLsizei",
         // "GLuint"                    => "types::GLuint",
         // "GLushort"                  => "types::GLushort",
-        "HANDLE"                    => "types::HANDLE",
-        "HDC"                       => "types::HDC",
-        "HENHMETAFILE"              => "types::HENHMETAFILE",
-        "HGLRC"                     => "types::HGLRC",
-        "HGPUNV"                    => "types::HGPUNV",
-        "HPBUFFERARB"               => "types::HPBUFFERARB",
-        "HPBUFFEREXT"               => "types::HPBUFFEREXT",
-        "HPVIDEODEV"                => "types::HPVIDEODEV",
-        "HVIDEOINPUTDEVICENV"       => "types::HVIDEOINPUTDEVICENV",
-        "HVIDEOOUTPUTDEVICENV"      => "types::HVIDEOOUTPUTDEVICENV",
-        "INT"                       => "types::INT",
-        "INT64"                     => "types::INT64",
-        "LPCSTR"                    => "types::LPCSTR",
-        "LPGLYPHMETRICSFLOAT"       => "types::LPGLYPHMETRICSFLOAT",
-        "LPVOID"                    => "types::LPVOID",
-        "PGPU_DEVICE"               => "types::PGPU_DEVICE",
-        "PROC"                      => "types::PROC",
-        "UINT"                      => "types::UINT",
-        "VOID"                      => "types::VOID",
+        "HANDLE" => "types::HANDLE",
+        "HDC" => "types::HDC",
+        "HENHMETAFILE" => "types::HENHMETAFILE",
+        "HGLRC" => "types::HGLRC",
+        "HGPUNV" => "types::HGPUNV",
+        "HPBUFFERARB" => "types::HPBUFFERARB",
+        "HPBUFFEREXT" => "types::HPBUFFEREXT",
+        "HPVIDEODEV" => "types::HPVIDEODEV",
+        "HVIDEOINPUTDEVICENV" => "types::HVIDEOINPUTDEVICENV",
+        "HVIDEOOUTPUTDEVICENV" => "types::HVIDEOOUTPUTDEVICENV",
+        "INT" => "types::INT",
+        "INT64" => "types::INT64",
+        "LPCSTR" => "types::LPCSTR",
+        "LPGLYPHMETRICSFLOAT" => "types::LPGLYPHMETRICSFLOAT",
+        "LPVOID" => "types::LPVOID",
+        "PGPU_DEVICE" => "types::PGPU_DEVICE",
+        "PROC" => "types::PROC",
+        "UINT" => "types::UINT",
+        "VOID" => "types::VOID",
         // "int "                      => "__gl_imports::raw::c_int",
         // "unsigned int "             => "__gl_imports::raw::c_uint",
         // "void "                     => "()",
-        "BOOL *"                    => "*mut types::BOOL",
-        "DWORD *"                   => "*mut types::DWORD",
-        "FLOAT *"                   => "*mut types::FLOAT",
+        "BOOL *" => "*mut types::BOOL",
+        "DWORD *" => "*mut types::DWORD",
+        "FLOAT *" => "*mut types::FLOAT",
         // "GLuint *"                  => "*mut types::GLuint",
-        "HANDLE *"                  => "*mut types::HANDLE",
-        "HGPUNV *"                  => "*mut types::HGPUNV",
-        "HPVIDEODEV *"              => "*mut types::HPVIDEODEV",
-        "HVIDEOINPUTDEVICENV *"     => "*mut types::HVIDEOINPUTDEVICENV",
-        "HVIDEOOUTPUTDEVICENV *"    => "*mut types::HVIDEOOUTPUTDEVICENV",
-        "INT32 *"                   => "*mut types::INT32",
-        "INT64 *"                   => "*mut types::INT64",
-        "UINT *"                    => "*mut types::UINT",
-        "USHORT *"                  => "*mut types::USHORT",
-        "const COLORREF *"          => "*const types::COLORREF",
-        "const DWORD *"             => "*const types::DWORD",
-        "const FLOAT *"             => "*const types::FLOAT",
+        "HANDLE *" => "*mut types::HANDLE",
+        "HGPUNV *" => "*mut types::HGPUNV",
+        "HPVIDEODEV *" => "*mut types::HPVIDEODEV",
+        "HVIDEOINPUTDEVICENV *" => "*mut types::HVIDEOINPUTDEVICENV",
+        "HVIDEOOUTPUTDEVICENV *" => "*mut types::HVIDEOOUTPUTDEVICENV",
+        "INT32 *" => "*mut types::INT32",
+        "INT64 *" => "*mut types::INT64",
+        "UINT *" => "*mut types::UINT",
+        "USHORT *" => "*mut types::USHORT",
+        "const COLORREF *" => "*const types::COLORREF",
+        "const DWORD *" => "*const types::DWORD",
+        "const FLOAT *" => "*const types::FLOAT",
         // "const GLushort *"          => "*const types::GLushort",
-        "const HANDLE *"            => "*const types::HANDLE",
-        "const HGPUNV *"            => "*const types::HGPUNV",
-        "const LAYERPLANEDESCRIPTOR *"  => "*const types::LAYERPLANEDESCRIPTOR",
-        "const LPVOID *"            => "*const types::LPVOID",
+        "const HANDLE *" => "*const types::HANDLE",
+        "const HGPUNV *" => "*const types::HGPUNV",
+        "const LAYERPLANEDESCRIPTOR *" => "*const types::LAYERPLANEDESCRIPTOR",
+        "const LPVOID *" => "*const types::LPVOID",
         "const PIXELFORMATDESCRIPTOR *" => "*const types::IXELFORMATDESCRIPTOR",
-        "const USHORT *"            => "*const types::USHORT",
+        "const USHORT *" => "*const types::USHORT",
         // "const char *"              => "*const __gl_imports::raw::c_char",
         // "const int *"               => "*const __gl_imports::raw::c_int",
-        "float *"                   => "*mut __gl_imports::raw::c_float",
+        "float *" => "*mut __gl_imports::raw::c_float",
         // "int *"                     => "*mut __gl_imports::raw::c_int",
         // "unsigned long *"           => "*mut __gl_imports::raw::c_ulong",
         // "void *"                    => "*mut __gl_imports::raw::c_void",
 
         // elx.xml types
-        "khronos_utime_nanoseconds_t"   => "types::khronos_utime_nanoseconds_t",
-        "khronos_uint64_t"          => "types::khronos_uint64_t",
-        "khronos_ssize_t"           => "types::khronos_ssize_t",
-        "EGLNativeDisplayType"      => "types::EGLNativeDisplayType",
-        "EGLNativePixmapType"       => "types::EGLNativePixmapType",
-        "EGLNativeWindowType"       => "types::EGLNativeWindowType",
-        "EGLint"                    => "types::EGLint",
-        "EGLint *"                  => "*mut types::EGLint",
-        "const EGLint *"            => "*const types::EGLint",
-        "NativeDisplayType"         => "types::NativeDisplayType",
-        "NativePixmapType"          => "types::NativePixmapType",
-        "NativeWindowType"          => "types::NativeWindowType",
+        "khronos_utime_nanoseconds_t" => "types::khronos_utime_nanoseconds_t",
+        "khronos_uint64_t" => "types::khronos_uint64_t",
+        "khronos_ssize_t" => "types::khronos_ssize_t",
+        "EGLNativeDisplayType" => "types::EGLNativeDisplayType",
+        "EGLNativePixmapType" => "types::EGLNativePixmapType",
+        "EGLNativeWindowType" => "types::EGLNativeWindowType",
+        "EGLint" => "types::EGLint",
+        "EGLint *" => "*mut types::EGLint",
+        "const EGLint *" => "*const types::EGLint",
+        "NativeDisplayType" => "types::NativeDisplayType",
+        "NativePixmapType" => "types::NativePixmapType",
+        "NativeWindowType" => "types::NativeWindowType",
         //"Bool"                      => "types::Bool",
-        "EGLBoolean"                => "types::EGLBoolean",
-        "EGLenum"                   => "types::EGLenum",
-        "EGLAttribKHR"              => "types::EGLAttribKHR",
-        "EGLAttrib"                 => "types::EGLAttrib",
-        "EGLAttrib *"               => "*mut types::EGLAttrib",
-        "const EGLAttrib *"         => "*const types::EGLAttrib",
-        "EGLConfig"                 => "types::EGLConfig",
-        "EGLConfig *"               => "*mut types::EGLConfig",
-        "EGLContext"                => "types::EGLContext",
-        "EGLDeviceEXT"              => "types::EGLDeviceEXT",
-        "EGLDisplay"                => "types::EGLDisplay",
-        "EGLSurface"                => "types::EGLSurface",
-        "EGLClientBuffer"           => "types::EGLClientBuffer",
+        "EGLBoolean" => "types::EGLBoolean",
+        "EGLenum" => "types::EGLenum",
+        "EGLAttribKHR" => "types::EGLAttribKHR",
+        "EGLAttrib" => "types::EGLAttrib",
+        "EGLAttrib *" => "*mut types::EGLAttrib",
+        "const EGLAttrib *" => "*const types::EGLAttrib",
+        "EGLConfig" => "types::EGLConfig",
+        "EGLConfig *" => "*mut types::EGLConfig",
+        "EGLContext" => "types::EGLContext",
+        "EGLDeviceEXT" => "types::EGLDeviceEXT",
+        "EGLDisplay" => "types::EGLDisplay",
+        "EGLSurface" => "types::EGLSurface",
+        "EGLClientBuffer" => "types::EGLClientBuffer",
         "__eglMustCastToProperFunctionPointerType" => "types::__eglMustCastToProperFunctionPointerType",
-        "EGLImageKHR"               => "types::EGLImageKHR",
-        "EGLImage"                  => "types::EGLImage",
-        "EGLOutputLayerEXT"         => "types::EGLOutputLayerEXT",
-        "EGLOutputPortEXT"          => "types::EGLOutputPortEXT",
-        "EGLSyncKHR"                => "types::EGLSyncKHR",
-        "EGLSync"                   => "types::EGLSync",
-        "EGLTimeKHR"                => "types::EGLTimeKHR",
-        "EGLTime"                   => "types::EGLTime",
-        "EGLSyncNV"                 => "types::EGLSyncNV",
-        "EGLTimeNV"                 => "types::EGLTimeNV",
-        "EGLuint64NV"               => "types::EGLuint64NV",
-        "EGLStreamKHR"              => "types::EGLStreamKHR",
-        "EGLuint64KHR"              => "types::EGLuint64KHR",
+        "EGLImageKHR" => "types::EGLImageKHR",
+        "EGLImage" => "types::EGLImage",
+        "EGLOutputLayerEXT" => "types::EGLOutputLayerEXT",
+        "EGLOutputPortEXT" => "types::EGLOutputPortEXT",
+        "EGLSyncKHR" => "types::EGLSyncKHR",
+        "EGLSync" => "types::EGLSync",
+        "EGLTimeKHR" => "types::EGLTimeKHR",
+        "EGLTime" => "types::EGLTime",
+        "EGLSyncNV" => "types::EGLSyncNV",
+        "EGLTimeNV" => "types::EGLTimeNV",
+        "EGLuint64NV" => "types::EGLuint64NV",
+        "EGLStreamKHR" => "types::EGLStreamKHR",
+        "EGLuint64KHR" => "types::EGLuint64KHR",
         "EGLNativeFileDescriptorKHR" => "types::EGLNativeFileDescriptorKHR",
-        "EGLsizeiANDROID"           => "types::EGLsizeiANDROID",
-        "EGLSetBlobFuncANDROID"     => "types::EGLSetBlobFuncANDROID",
-        "EGLGetBlobFuncANDROID"     => "types::EGLGetBlobFuncANDROID",
-        "EGLClientPixmapHI"         => "types::EGLClientPixmapHI",
+        "EGLsizeiANDROID" => "types::EGLsizeiANDROID",
+        "EGLSetBlobFuncANDROID" => "types::EGLSetBlobFuncANDROID",
+        "EGLGetBlobFuncANDROID" => "types::EGLGetBlobFuncANDROID",
+        "EGLClientPixmapHI" => "types::EGLClientPixmapHI",
         "struct EGLClientPixmapHI *" => "*const types::EGLClientPixmapHI",
-        "const EGLAttribKHR *"      => "*const types::EGLAttribKHR",
-        "const EGLuint64KHR *"      => "*const types::EGLuint64KHR",
-        "EGLAttribKHR *"            => "*mut types::EGLAttribKHR",
-        "EGLDeviceEXT *"            => "*mut types::EGLDeviceEXT",
-        "EGLNativeDisplayType *"    => "*mut types::EGLNativeDisplayType",
-        "EGLNativePixmapType *"     => "*mut types::EGLNativePixmapType",
-        "EGLNativeWindowType *"     => "*mut types::EGLNativeWindowType",
-        "EGLOutputLayerEXT *"       => "*mut types::EGLOutputLayerEXT",
-        "EGLTimeKHR *"              => "*mut types::EGLTimeKHR",
-        "EGLOutputPortEXT *"        => "*mut types::EGLOutputPortEXT",
-        "EGLuint64KHR *"            => "*mut types::EGLuint64KHR",
+        "const EGLAttribKHR *" => "*const types::EGLAttribKHR",
+        "const EGLuint64KHR *" => "*const types::EGLuint64KHR",
+        "EGLAttribKHR *" => "*mut types::EGLAttribKHR",
+        "EGLDeviceEXT *" => "*mut types::EGLDeviceEXT",
+        "EGLNativeDisplayType *" => "*mut types::EGLNativeDisplayType",
+        "EGLNativePixmapType *" => "*mut types::EGLNativePixmapType",
+        "EGLNativeWindowType *" => "*mut types::EGLNativeWindowType",
+        "EGLOutputLayerEXT *" => "*mut types::EGLOutputLayerEXT",
+        "EGLTimeKHR *" => "*mut types::EGLTimeKHR",
+        "EGLOutputPortEXT *" => "*mut types::EGLOutputPortEXT",
+        "EGLuint64KHR *" => "*mut types::EGLuint64KHR",
 
         // failure
         _ => panic!("Type conversion not implemented for `{}`", ty.as_ref()),
@@ -998,7 +1022,10 @@ mod tests {
 
         #[test]
         fn test_cast_0() {
-            let e = parse::make_enum("FOO".to_string(), None, "((EGLint)-1)".to_string(), Some("BAR".to_string()));
+            let e = parse::make_enum("FOO".to_string(),
+                                     None,
+                                     "((EGLint)-1)".to_string(),
+                                     Some("BAR".to_string()));
             assert_eq!(e.ident, "FOO");
             assert_eq!((&*e.ty, &*e.value), ("EGLint", "-1"));
             assert_eq!(e.alias, Some("BAR".to_string()));
@@ -1006,7 +1033,10 @@ mod tests {
 
         #[test]
         fn test_cast_1() {
-            let e = parse::make_enum("FOO".to_string(), None, "((EGLint)(-1))".to_string(), Some("BAR".to_string()));
+            let e = parse::make_enum("FOO".to_string(),
+                                     None,
+                                     "((EGLint)(-1))".to_string(),
+                                     Some("BAR".to_string()));
             assert_eq!(e.ident, "FOO");
             assert_eq!((&*e.ty, &*e.value), ("EGLint", "(-1)"));
             assert_eq!(e.alias, Some("BAR".to_string()));
@@ -1014,7 +1044,10 @@ mod tests {
 
         #[test]
         fn test_no_type() {
-            let e = parse::make_enum("FOO".to_string(), None, "value".to_string(), Some("BAR".to_string()));
+            let e = parse::make_enum("FOO".to_string(),
+                                     None,
+                                     "value".to_string(),
+                                     Some("BAR".to_string()));
             assert_eq!(e.ident, "FOO");
             assert_eq!(e.value, "value");
             assert_eq!(e.alias, Some("BAR".to_string()));
@@ -1024,20 +1057,29 @@ mod tests {
 
         #[test]
         fn test_u() {
-            let e = parse::make_enum("FOO".to_string(), Some("u".to_string()), String::new(), None);
+            let e = parse::make_enum("FOO".to_string(),
+                                     Some("u".to_string()),
+                                     String::new(),
+                                     None);
             assert_eq!(e.ty, "GLuint");
         }
 
         #[test]
         fn test_ull() {
-            let e = parse::make_enum("FOO".to_string(), Some("ull".to_string()), String::new(), None);
+            let e = parse::make_enum("FOO".to_string(),
+                                     Some("ull".to_string()),
+                                     String::new(),
+                                     None);
             assert_eq!(e.ty, "GLuint64");
         }
 
         #[test]
         #[should_panic]
         fn test_unknown_type() {
-            parse::make_enum("FOO".to_string(), Some("blargh".to_string()), String::new(), None);
+            parse::make_enum("FOO".to_string(),
+                             Some("blargh".to_string()),
+                             String::new(),
+                             None);
         }
 
         #[test]
@@ -1073,27 +1115,19 @@ mod tests {
             fn test_start_event() {
                 let given = XmlEvent::StartElement {
                     name: OwnedName::local("element"),
-                    attributes: vec![
-                        OwnedAttribute::new(OwnedName::local("attr1"), "val1"),
-                        OwnedAttribute::new(OwnedName::local("attr2"), "val2"),
-                    ],
+                    attributes: vec![OwnedAttribute::new(OwnedName::local("attr1"), "val1"),
+                                     OwnedAttribute::new(OwnedName::local("attr2"), "val2")],
                     namespace: Namespace::empty(),
                 };
-                let expected = ParseEvent::Start(
-                    "element".to_string(),
-                    vec![
-                        Attribute::new("attr1", "val1"),
-                        Attribute::new("attr2", "val2"),
-                    ],
-                );
+                let expected = ParseEvent::Start("element".to_string(),
+                                                 vec![Attribute::new("attr1", "val1"),
+                                                      Attribute::new("attr2", "val2")]);
                 assert_eq!(ParseEvent::from_xml(given), Some(expected));
             }
 
             #[test]
             fn test_end_element() {
-                let given = XmlEvent::EndElement {
-                    name: OwnedName::local("element"),
-                };
+                let given = XmlEvent::EndElement { name: OwnedName::local("element") };
                 let expected = ParseEvent::End("element".to_string());
                 assert_eq!(ParseEvent::from_xml(given), Some(expected));
             }
diff --git a/khronos_api/Cargo.toml b/khronos_api/Cargo.toml
index ecf29527..d52178aa 100644
--- a/khronos_api/Cargo.toml
+++ b/khronos_api/Cargo.toml
@@ -1,5 +1,4 @@
 [package]
-
 name = "khronos_api"
 version = "1.0.0"
 authors = [
@@ -10,9 +9,9 @@ authors = [
 ]
 description = "The Khronos XML API Registry, exposed as byte string constants."
 license = "Apache-2.0"
-
-homepage = "https://github.com/bjz/gl-rs/khronos_api/"
-repository = "https://github.com/bjz/gl-rs/"
+documentation = "https://docs.rs/khronos_api"
+homepage = "https://github.com/brendanzab/gl-rs/khronos_api/"
+repository = "https://github.com/brendanzab/gl-rs/"
 readme = "README.md"
 
 keywords = ["opengl", "khronos"]
diff --git a/khronos_api/README.md b/khronos_api/README.md
index b281a748..785e64c8 100644
--- a/khronos_api/README.md
+++ b/khronos_api/README.md
@@ -1,7 +1,7 @@
 # khronos_api
 
 [![Version](https://img.shields.io/crates/v/khronos_api.svg)](https://crates.io/crates/khronos_api)
-[![License](https://img.shields.io/crates/l/khronos_api.svg)](https://github.com/bjz/gl-rs/blob/master/LICENSE)
+[![License](https://img.shields.io/crates/l/khronos_api.svg)](https://github.com/brendanzab/gl-rs/blob/master/LICENSE)
 [![Downloads](https://img.shields.io/crates/d/khronos_api.svg)](https://crates.io/crates/khronos_api)
 
 The Khronos XML API Registry, exposed as byte string constants.


Test patch:
diff --git a/gl_tests/test_add_registries/Cargo.toml b/tests/test_add_registries/Cargo.toml
similarity index 72%
rename from gl_tests/test_add_registries/Cargo.toml
rename to tests/test_add_registries/Cargo.toml
index c3c511e5..106e594e 100644
--- a/gl_tests/test_add_registries/Cargo.toml
+++ b/tests/test_add_registries/Cargo.toml
@@ -1,8 +1,8 @@
 [package]
-# we don't include some metadata to avoid accidental publishes
 name = "test_add_registries"
 version = "0.0.0"
 build = "build.rs"
+publish = false
 
 [lib]
 path = "lib.rs"
diff --git a/gl_tests/test_add_registries/build.rs b/tests/test_add_registries/build.rs
similarity index 100%
rename from gl_tests/test_add_registries/build.rs
rename to tests/test_add_registries/build.rs
diff --git a/gl_tests/test_add_registries/lib.rs b/tests/test_add_registries/lib.rs
similarity index 100%
rename from gl_tests/test_add_registries/lib.rs
rename to tests/test_add_registries/lib.rs
diff --git a/gl_tests/test_gen_symbols/Cargo.toml b/tests/test_gen_symbols/Cargo.toml
similarity index 72%
rename from gl_tests/test_gen_symbols/Cargo.toml
rename to tests/test_gen_symbols/Cargo.toml
index d254c5b2..908b265d 100644
--- a/gl_tests/test_gen_symbols/Cargo.toml
+++ b/tests/test_gen_symbols/Cargo.toml
@@ -1,8 +1,8 @@
 [package]
-# we don't include some metadata to avoid accidental publishes
 name = "test_gen_symbols"
 version = "0.0.0"
 build = "build.rs"
+publish = false
 
 [lib]
 path = "lib.rs"
diff --git a/gl_tests/test_gen_symbols/build.rs b/tests/test_gen_symbols/build.rs
similarity index 100%
rename from gl_tests/test_gen_symbols/build.rs
rename to tests/test_gen_symbols/build.rs
diff --git a/gl_tests/test_gen_symbols/lib.rs b/tests/test_gen_symbols/lib.rs
similarity index 100%
rename from gl_tests/test_gen_symbols/lib.rs
rename to tests/test_gen_symbols/lib.rs
diff --git a/gl_tests/test_no_warnings/Cargo.toml b/tests/test_no_warnings/Cargo.toml
similarity index 72%
rename from gl_tests/test_no_warnings/Cargo.toml
rename to tests/test_no_warnings/Cargo.toml
index de589402..a597ae6f 100644
--- a/gl_tests/test_no_warnings/Cargo.toml
+++ b/tests/test_no_warnings/Cargo.toml
@@ -1,8 +1,8 @@
 [package]
-# we don't include some metadata to avoid accidental publishes
 name = "test_no_warnings"
 version = "0.0.0"
 build = "build.rs"
+publish = false
 
 [lib]
 path = "lib.rs"
diff --git a/gl_tests/test_no_warnings/build.rs b/tests/test_no_warnings/build.rs
similarity index 64%
rename from gl_tests/test_no_warnings/build.rs
rename to tests/test_no_warnings/build.rs
index f371cfb7..faf59e76 100644
--- a/gl_tests/test_no_warnings/build.rs
+++ b/tests/test_no_warnings/build.rs
@@ -29,23 +29,33 @@ fn main() {
     let gl_registry = Registry::new(Api::Gl, (4, 5), Profile::Core, Fallbacks::All, []);
 
     writeln!(&mut file, "mod gl_global {{").unwrap();
-    gl_registry.write_bindings(GlobalGenerator, &mut file).unwrap();
+    gl_registry
+        .write_bindings(GlobalGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gl_static {{").unwrap();
-    gl_registry.write_bindings(StaticGenerator, &mut file).unwrap();
+    gl_registry
+        .write_bindings(StaticGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gl_struct {{").unwrap();
-    gl_registry.write_bindings(StructGenerator, &mut file).unwrap();
+    gl_registry
+        .write_bindings(StructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gl_static_struct {{").unwrap();
-    gl_registry.write_bindings(StaticStructGenerator, &mut file).unwrap();
+    gl_registry
+        .write_bindings(StaticStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gl_debug_struct {{").unwrap();
-    gl_registry.write_bindings(DebugStructGenerator, &mut file).unwrap();
+    gl_registry
+        .write_bindings(DebugStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     // Glx
@@ -53,23 +63,33 @@ fn main() {
     let glx_registry = Registry::new(Api::Glx, (1, 4), Profile::Core, Fallbacks::All, []);
 
     writeln!(&mut file, "mod glx_global {{").unwrap();
-    glx_registry.write_bindings(GlobalGenerator, &mut file).unwrap();
+    glx_registry
+        .write_bindings(GlobalGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod glx_static {{").unwrap();
-    glx_registry.write_bindings(StaticGenerator, &mut file).unwrap();
+    glx_registry
+        .write_bindings(StaticGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod glx_struct {{").unwrap();
-    glx_registry.write_bindings(StructGenerator, &mut file).unwrap();
+    glx_registry
+        .write_bindings(StructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod glx_static_struct {{").unwrap();
-    glx_registry.write_bindings(StaticStructGenerator, &mut file).unwrap();
+    glx_registry
+        .write_bindings(StaticStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod glx_debug_struct {{").unwrap();
-    glx_registry.write_bindings(DebugStructGenerator, &mut file).unwrap();
+    glx_registry
+        .write_bindings(DebugStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     // Wgl
@@ -77,23 +97,33 @@ fn main() {
     let wgl_registry = Registry::new(Api::Wgl, (1, 0), Profile::Core, Fallbacks::All, []);
 
     writeln!(&mut file, "mod wgl_global {{").unwrap();
-    wgl_registry.write_bindings(GlobalGenerator, &mut file).unwrap();
+    wgl_registry
+        .write_bindings(GlobalGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod wgl_static {{").unwrap();
-    wgl_registry.write_bindings(StaticGenerator, &mut file).unwrap();
+    wgl_registry
+        .write_bindings(StaticGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod wgl_struct {{").unwrap();
-    wgl_registry.write_bindings(StructGenerator, &mut file).unwrap();
+    wgl_registry
+        .write_bindings(StructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod wgl_static_struct {{").unwrap();
-    wgl_registry.write_bindings(StaticStructGenerator, &mut file).unwrap();
+    wgl_registry
+        .write_bindings(StaticStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod wgl_debug_struct {{").unwrap();
-    wgl_registry.write_bindings(DebugStructGenerator, &mut file).unwrap();
+    wgl_registry
+        .write_bindings(DebugStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     // Gles1
@@ -101,23 +131,33 @@ fn main() {
     let gles1_registry = Registry::new(Api::Gles1, (1, 1), Profile::Core, Fallbacks::All, []);
 
     writeln!(&mut file, "mod gles1_global {{").unwrap();
-    gles1_registry.write_bindings(GlobalGenerator, &mut file).unwrap();
+    gles1_registry
+        .write_bindings(GlobalGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles1_static {{").unwrap();
-    gles1_registry.write_bindings(StaticGenerator, &mut file).unwrap();
+    gles1_registry
+        .write_bindings(StaticGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles1_struct {{").unwrap();
-    gles1_registry.write_bindings(StructGenerator, &mut file).unwrap();
+    gles1_registry
+        .write_bindings(StructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles1_static_struct {{").unwrap();
-    gles1_registry.write_bindings(StaticStructGenerator, &mut file).unwrap();
+    gles1_registry
+        .write_bindings(StaticStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles1_debug_struct {{").unwrap();
-    gles1_registry.write_bindings(DebugStructGenerator, &mut file).unwrap();
+    gles1_registry
+        .write_bindings(DebugStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     // Gles2
@@ -125,23 +165,33 @@ fn main() {
     let gles2_registry = Registry::new(Api::Gles2, (3, 1), Profile::Core, Fallbacks::All, []);
 
     writeln!(&mut file, "mod gles2_global {{").unwrap();
-    gles2_registry.write_bindings(GlobalGenerator, &mut file).unwrap();
+    gles2_registry
+        .write_bindings(GlobalGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles2_static {{").unwrap();
-    gles2_registry.write_bindings(StaticGenerator, &mut file).unwrap();
+    gles2_registry
+        .write_bindings(StaticGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles2_struct {{").unwrap();
-    gles2_registry.write_bindings(StructGenerator, &mut file).unwrap();
+    gles2_registry
+        .write_bindings(StructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles2_static_struct {{").unwrap();
-    gles2_registry.write_bindings(StaticStructGenerator, &mut file).unwrap();
+    gles2_registry
+        .write_bindings(StaticStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod gles2_debug_struct {{").unwrap();
-    gles2_registry.write_bindings(DebugStructGenerator, &mut file).unwrap();
+    gles2_registry
+        .write_bindings(DebugStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     // Egl
@@ -149,23 +199,36 @@ fn main() {
     let egl_registry = Registry::new(Api::Egl, (1, 5), Profile::Core, Fallbacks::All, []);
 
     writeln!(&mut file, "mod egl_global {{ {}", build_egl_symbols()).unwrap();
-    egl_registry.write_bindings(GlobalGenerator, &mut file).unwrap();
+    egl_registry
+        .write_bindings(GlobalGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod egl_static {{ {}", build_egl_symbols()).unwrap();
-    egl_registry.write_bindings(StaticGenerator, &mut file).unwrap();
+    egl_registry
+        .write_bindings(StaticGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod egl_struct {{ {}", build_egl_symbols()).unwrap();
-    egl_registry.write_bindings(StructGenerator, &mut file).unwrap();
+    egl_registry
+        .write_bindings(StructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
-    writeln!(&mut file, "mod egl_static_struct {{ {}", build_egl_symbols()).unwrap();
-    egl_registry.write_bindings(StaticStructGenerator, &mut file).unwrap();
+    writeln!(&mut file,
+             "mod egl_static_struct {{ {}",
+             build_egl_symbols())
+            .unwrap();
+    egl_registry
+        .write_bindings(StaticStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 
     writeln!(&mut file, "mod egl_debug_struct {{ {}", build_egl_symbols()).unwrap();
-    egl_registry.write_bindings(DebugStructGenerator, &mut file).unwrap();
+    egl_registry
+        .write_bindings(DebugStructGenerator, &mut file)
+        .unwrap();
     writeln!(&mut file, "}}").unwrap();
 }
 
diff --git a/gl_tests/test_no_warnings/lib.rs b/tests/test_no_warnings/lib.rs
similarity index 100%
rename from gl_tests/test_no_warnings/lib.rs
rename to tests/test_no_warnings/lib.rs
diff --git a/gl_tests/test_symbols/Cargo.toml b/tests/test_symbols/Cargo.toml
similarity index 71%
rename from gl_tests/test_symbols/Cargo.toml
rename to tests/test_symbols/Cargo.toml
index b2ceae81..062eb8da 100644
--- a/gl_tests/test_symbols/Cargo.toml
+++ b/tests/test_symbols/Cargo.toml
@@ -1,8 +1,8 @@
 [package]
-# we don't include some metadata to avoid accidental publishes
 name = "test_symbols"
 version = "0.0.0"
 build = "build.rs"
+publish = false
 
 [lib]
 path = "lib.rs"
diff --git a/gl_tests/test_symbols/build.rs b/tests/test_symbols/build.rs
similarity index 100%
rename from gl_tests/test_symbols/build.rs
rename to tests/test_symbols/build.rs
diff --git a/gl_tests/test_symbols/lib.rs b/tests/test_symbols/lib.rs
similarity index 100%
rename from gl_tests/test_symbols/lib.rs
rename to tests/test_symbols/lib.rs
diff --git a/gl_tests/test_unstable_api/Cargo.toml b/tests/test_unstable_api/Cargo.toml
similarity index 76%
rename from gl_tests/test_unstable_api/Cargo.toml
rename to tests/test_unstable_api/Cargo.toml
index be741020..7a1d1d45 100644
--- a/gl_tests/test_unstable_api/Cargo.toml
+++ b/tests/test_unstable_api/Cargo.toml
@@ -1,8 +1,8 @@
 [package]
-# we don't include some metadata to avoid accidental publishes
 name = "test_unstable_api"
 version = "0.0.0"
 build = "build.rs"
+publish = false
 
 [lib]
 path = "lib.rs"
diff --git a/gl_tests/test_unstable_api/build.rs b/tests/test_unstable_api/build.rs
similarity index 100%
rename from gl_tests/test_unstable_api/build.rs
rename to tests/test_unstable_api/build.rs
diff --git a/gl_tests/test_unstable_api/lib.rs b/tests/test_unstable_api/lib.rs
similarity index 100%
rename from gl_tests/test_unstable_api/lib.rs
rename to tests/test_unstable_api/lib.rs
diff --git a/gl_tests/test_with_extensions/Cargo.toml b/tests/test_with_extensions/Cargo.toml
similarity index 72%
rename from gl_tests/test_with_extensions/Cargo.toml
rename to tests/test_with_extensions/Cargo.toml
index 960f2d0b..324cdbac 100644
--- a/gl_tests/test_with_extensions/Cargo.toml
+++ b/tests/test_with_extensions/Cargo.toml
@@ -1,8 +1,8 @@
 [package]
-# we don't include some metadata to avoid accidental publishes
 name = "test_with_extensions"
 version = "0.0.0"
 build = "build.rs"
+publish = false
 
 [lib]
 path = "lib.rs"
diff --git a/gl_tests/test_with_extensions/build.rs b/tests/test_with_extensions/build.rs
similarity index 94%
rename from gl_tests/test_with_extensions/build.rs
rename to tests/test_with_extensions/build.rs
index 4b4ae4ab..01822265 100644
--- a/gl_tests/test_with_extensions/build.rs
+++ b/tests/test_with_extensions/build.rs
@@ -22,8 +22,9 @@ use std::path::*;
 fn main() {
     let dest = env::var("OUT_DIR").unwrap();
     let mut file = File::create(&Path::new(&dest).join("test_symbols.rs")).unwrap();
+    let extensions = ["GL_ARB_debug_output"];
 
-    Registry::new(Api::Gl, (4, 5), Profile::Core, Fallbacks::All, ["GL_ARB_debug_output"])
+    Registry::new(Api::Gl, (4, 5), Profile::Core, Fallbacks::All, extensions)
         .write_bindings(GlobalGenerator, &mut file)
         .unwrap();
 }
diff --git a/gl_tests/test_with_extensions/lib.rs b/tests/test_with_extensions/lib.rs
similarity index 100%
rename from gl_tests/test_with_extensions/lib.rs
rename to tests/test_with_extensions/lib.rs