Initial set of third-party Rust crates.

Change-Id: Ib5201545ed361f82ec9891e2d1fe804b64e3f76f
diff --git a/vendor/bitflags-0.7.0/.cargo-checksum.json b/vendor/bitflags-0.7.0/.cargo-checksum.json
new file mode 100644
index 0000000..c2012b5
--- /dev/null
+++ b/vendor/bitflags-0.7.0/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"c1e953ee360e77de57f7b02f1b7880bd6a3dc22d1a69e953c2ac2c52cc52d247",".travis.yml":"2b615144d3f4b2e63ba6ec435cc18df7d76354aa07c2a02d6c707028cc448784","Cargo.toml":"db8c2e9ea912c5f3d2d89cf4cf936c448300e356b0fb533db8875923cb135256","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"8cfbc986af45867d9e620188af2392320fe6e0d9536753ba415c94ab522f5fb5","src/lib.rs":"618ce383bb219725363fba174fc66beb4874d9682e5da953f9e3e9cb3f786d5f","tests/external.rs":"546e549ec831876a5dc272bd0537adc9e9886c6da54656c825e7bffc079e2c74","tests/external_no_std.rs":"48929f5109aabc156442d5ae2ab07b4bce5d648488bf49dba725f6ab23bcb48a"},"package":"aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"}
\ No newline at end of file
diff --git a/vendor/bitflags-0.7.0/.cargo-ok b/vendor/bitflags-0.7.0/.cargo-ok
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vendor/bitflags-0.7.0/.cargo-ok
diff --git a/vendor/bitflags-0.7.0/.gitignore b/vendor/bitflags-0.7.0/.gitignore
new file mode 100644
index 0000000..4fffb2f
--- /dev/null
+++ b/vendor/bitflags-0.7.0/.gitignore
@@ -0,0 +1,2 @@
+/target
+/Cargo.lock
diff --git a/vendor/bitflags-0.7.0/.travis.yml b/vendor/bitflags-0.7.0/.travis.yml
new file mode 100644
index 0000000..6034446
--- /dev/null
+++ b/vendor/bitflags-0.7.0/.travis.yml
@@ -0,0 +1,24 @@
+language: rust
+rust:
+  - stable
+  - beta
+  - nightly
+sudo: false
+script:
+  - cargo build --verbose
+  - cargo test --verbose
+  - cargo doc
+after_success: |
+  [ $TRAVIS_BRANCH = master ] &&
+  [ $TRAVIS_PULL_REQUEST = false ] &&
+  [ $TRAVIS_RUST_VERSION = nightly ] &&
+  echo '<meta http-equiv=refresh content=0;url=bitflags/index.html>' > target/doc/index.html &&
+  pip install ghp-import --user $USER &&
+  $HOME/.local/bin/ghp-import -n target/doc &&
+  git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
+env:
+  global:
+    secure: d+l63TtlF6cfFVDGauYRexgx4lBww4ORqqK4Vt75nWbiCbjZYsKXbcTUdhAr193nIVGiNW50A8SekM01F3EngHwHwr6u5kFleOggm+HA0kkBVeX+k2A4WCVVfYI+gth+zk99WaF8h46MA0evhx6FYDoqeyl9oqmVifI4kaqhMwc=
+notifications:
+  email:
+    on_success: never
diff --git a/vendor/bitflags-0.7.0/Cargo.toml b/vendor/bitflags-0.7.0/Cargo.toml
new file mode 100644
index 0000000..042497e
--- /dev/null
+++ b/vendor/bitflags-0.7.0/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+
+name = "bitflags"
+version = "0.7.0"
+authors = ["The Rust Project Developers"]
+license = "MIT/Apache-2.0"
+readme = "README.md"
+repository = "https://github.com/rust-lang/bitflags"
+homepage = "https://github.com/rust-lang/bitflags"
+documentation = "https://doc.rust-lang.org/bitflags"
+description = """
+A macro to generate structures which behave like bitflags.
+"""
diff --git a/vendor/bitflags-0.7.0/LICENSE-APACHE b/vendor/bitflags-0.7.0/LICENSE-APACHE
new file mode 100644
index 0000000..16fe87b
--- /dev/null
+++ b/vendor/bitflags-0.7.0/LICENSE-APACHE
@@ -0,0 +1,201 @@
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+   "License" shall mean the terms and conditions for use, reproduction,
+   and distribution as defined by Sections 1 through 9 of this document.
+
+   "Licensor" shall mean the copyright owner or entity authorized by
+   the copyright owner that is granting the License.
+
+   "Legal Entity" shall mean the union of the acting entity and all
+   other entities that control, are controlled by, or are under common
+   control with that entity. For the purposes of this definition,
+   "control" means (i) the power, direct or indirect, to cause the
+   direction or management of such entity, whether by contract or
+   otherwise, or (ii) ownership of fifty percent (50%) or more of the
+   outstanding shares, or (iii) beneficial ownership of such entity.
+
+   "You" (or "Your") shall mean an individual or Legal Entity
+   exercising permissions granted by this License.
+
+   "Source" form shall mean the preferred form for making modifications,
+   including but not limited to software source code, documentation
+   source, and configuration files.
+
+   "Object" form shall mean any form resulting from mechanical
+   transformation or translation of a Source form, including but
+   not limited to compiled object code, generated documentation,
+   and conversions to other media types.
+
+   "Work" shall mean the work of authorship, whether in Source or
+   Object form, made available under the License, as indicated by a
+   copyright notice that is included in or attached to the work
+   (an example is provided in the Appendix below).
+
+   "Derivative Works" shall mean any work, whether in Source or Object
+   form, that is based on (or derived from) the Work and for which the
+   editorial revisions, annotations, elaborations, or other modifications
+   represent, as a whole, an original work of authorship. For the purposes
+   of this License, Derivative Works shall not include works that remain
+   separable from, or merely link (or bind by name) to the interfaces of,
+   the Work and Derivative Works thereof.
+
+   "Contribution" shall mean any work of authorship, including
+   the original version of the Work and any modifications or additions
+   to that Work or Derivative Works thereof, that is intentionally
+   submitted to Licensor for inclusion in the Work by the copyright owner
+   or by an individual or Legal Entity authorized to submit on behalf of
+   the copyright owner. For the purposes of this definition, "submitted"
+   means any form of electronic, verbal, or written communication sent
+   to the Licensor or its representatives, including but not limited to
+   communication on electronic mailing lists, source code control systems,
+   and issue tracking systems that are managed by, or on behalf of, the
+   Licensor for the purpose of discussing and improving the Work, but
+   excluding communication that is conspicuously marked or otherwise
+   designated in writing by the copyright owner as "Not a Contribution."
+
+   "Contributor" shall mean Licensor and any individual or Legal Entity
+   on behalf of whom a Contribution has been received by Licensor and
+   subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   copyright license to reproduce, prepare Derivative Works of,
+   publicly display, publicly perform, sublicense, and distribute the
+   Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+   this License, each Contributor hereby grants to You a perpetual,
+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+   (except as stated in this section) patent license to make, have made,
+   use, offer to sell, sell, import, and otherwise transfer the Work,
+   where such license applies only to those patent claims licensable
+   by such Contributor that are necessarily infringed by their
+   Contribution(s) alone or by combination of their Contribution(s)
+   with the Work to which such Contribution(s) was submitted. If You
+   institute patent litigation against any entity (including a
+   cross-claim or counterclaim in a lawsuit) alleging that the Work
+   or a Contribution incorporated within the Work constitutes direct
+   or contributory patent infringement, then any patent licenses
+   granted to You under this License for that Work shall terminate
+   as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+   Work or Derivative Works thereof in any medium, with or without
+   modifications, and in Source or Object form, provided that You
+   meet the following conditions:
+
+   (a) You must give any other recipients of the Work or
+       Derivative Works a copy of this License; and
+
+   (b) You must cause any modified files to carry prominent notices
+       stating that You changed the files; and
+
+   (c) You must retain, in the Source form of any Derivative Works
+       that You distribute, all copyright, patent, trademark, and
+       attribution notices from the Source form of the Work,
+       excluding those notices that do not pertain to any part of
+       the Derivative Works; and
+
+   (d) If the Work includes a "NOTICE" text file as part of its
+       distribution, then any Derivative Works that You distribute must
+       include a readable copy of the attribution notices contained
+       within such NOTICE file, excluding those notices that do not
+       pertain to any part of the Derivative Works, in at least one
+       of the following places: within a NOTICE text file distributed
+       as part of the Derivative Works; within the Source form or
+       documentation, if provided along with the Derivative Works; or,
+       within a display generated by the Derivative Works, if and
+       wherever such third-party notices normally appear. The contents
+       of the NOTICE file are for informational purposes only and
+       do not modify the License. You may add Your own attribution
+       notices within Derivative Works that You distribute, alongside
+       or as an addendum to the NOTICE text from the Work, provided
+       that such additional attribution notices cannot be construed
+       as modifying the License.
+
+   You may add Your own copyright statement to Your modifications and
+   may provide additional or different license terms and conditions
+   for use, reproduction, or distribution of Your modifications, or
+   for any such Derivative Works as a whole, provided Your use,
+   reproduction, and distribution of the Work otherwise complies with
+   the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+   any Contribution intentionally submitted for inclusion in the Work
+   by You to the Licensor shall be under the terms and conditions of
+   this License, without any additional terms or conditions.
+   Notwithstanding the above, nothing herein shall supersede or modify
+   the terms of any separate license agreement you may have executed
+   with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+   names, trademarks, service marks, or product names of the Licensor,
+   except as required for reasonable and customary use in describing the
+   origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+   agreed to in writing, Licensor provides the Work (and each
+   Contributor provides its Contributions) on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied, including, without limitation, any warranties or conditions
+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+   PARTICULAR PURPOSE. You are solely responsible for determining the
+   appropriateness of using or redistributing the Work and assume any
+   risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+   whether in tort (including negligence), contract, or otherwise,
+   unless required by applicable law (such as deliberate and grossly
+   negligent acts) or agreed to in writing, shall any Contributor be
+   liable to You for damages, including any direct, indirect, special,
+   incidental, or consequential damages of any character arising as a
+   result of this License or out of the use or inability to use the
+   Work (including but not limited to damages for loss of goodwill,
+   work stoppage, computer failure or malfunction, or any and all
+   other commercial damages or losses), even if such Contributor
+   has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+   the Work or Derivative Works thereof, You may choose to offer,
+   and charge a fee for, acceptance of support, warranty, indemnity,
+   or other liability obligations and/or rights consistent with this
+   License. However, in accepting such obligations, You may act only
+   on Your own behalf and on Your sole responsibility, not on behalf
+   of any other Contributor, and only if You agree to indemnify,
+   defend, and hold each Contributor harmless for any liability
+   incurred by, or claims asserted against, such Contributor by reason
+   of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+	http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/vendor/bitflags-0.7.0/LICENSE-MIT b/vendor/bitflags-0.7.0/LICENSE-MIT
new file mode 100644
index 0000000..39d4bdb
--- /dev/null
+++ b/vendor/bitflags-0.7.0/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2014 The Rust Project Developers
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/vendor/bitflags-0.7.0/README.md b/vendor/bitflags-0.7.0/README.md
new file mode 100644
index 0000000..3edd8a3
--- /dev/null
+++ b/vendor/bitflags-0.7.0/README.md
@@ -0,0 +1,24 @@
+bitflags
+========
+
+A Rust macro to generate structures which behave like a set of bitflags
+
+[![Build Status](https://travis-ci.org/rust-lang-nursery/bitflags.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/bitflags)
+
+[Documentation](https://doc.rust-lang.org/bitflags)
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+bitflags = "0.6"
+```
+
+and this to your crate root:
+
+```rust
+#[macro_use]
+extern crate bitflags;
+```
diff --git a/vendor/bitflags-0.7.0/src/lib.rs b/vendor/bitflags-0.7.0/src/lib.rs
new file mode 100644
index 0000000..698799d
--- /dev/null
+++ b/vendor/bitflags-0.7.0/src/lib.rs
@@ -0,0 +1,808 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! A typesafe bitmask flag generator.
+
+#![no_std]
+
+#[cfg(test)]
+#[macro_use]
+extern crate std;
+
+// Re-export libstd/libcore using an alias so that the macros can work in no_std
+// crates while remaining compatible with normal crates.
+#[allow(private_in_public)]
+#[doc(hidden)]
+pub use core as __core;
+
+/// The `bitflags!` macro generates a `struct` that holds a set of C-style
+/// bitmask flags. It is useful for creating typesafe wrappers for C APIs.
+///
+/// The flags should only be defined for integer types, otherwise unexpected
+/// type errors may occur at compile time.
+///
+/// # Example
+///
+/// ```{.rust}
+/// #[macro_use]
+/// extern crate bitflags;
+///
+/// bitflags! {
+///     flags Flags: u32 {
+///         const FLAG_A       = 0b00000001,
+///         const FLAG_B       = 0b00000010,
+///         const FLAG_C       = 0b00000100,
+///         const FLAG_ABC     = FLAG_A.bits
+///                            | FLAG_B.bits
+///                            | FLAG_C.bits,
+///     }
+/// }
+///
+/// fn main() {
+///     let e1 = FLAG_A | FLAG_C;
+///     let e2 = FLAG_B | FLAG_C;
+///     assert_eq!((e1 | e2), FLAG_ABC);   // union
+///     assert_eq!((e1 & e2), FLAG_C);     // intersection
+///     assert_eq!((e1 - e2), FLAG_A);     // set difference
+///     assert_eq!(!e2, FLAG_A);           // set complement
+/// }
+/// ```
+///
+/// The generated `struct`s can also be extended with type and trait
+/// implementations:
+///
+/// ```{.rust}
+/// #[macro_use]
+/// extern crate bitflags;
+///
+/// use std::fmt;
+///
+/// bitflags! {
+///     flags Flags: u32 {
+///         const FLAG_A   = 0b00000001,
+///         const FLAG_B   = 0b00000010,
+///     }
+/// }
+///
+/// impl Flags {
+///     pub fn clear(&mut self) {
+///         self.bits = 0;  // The `bits` field can be accessed from within the
+///                         // same module where the `bitflags!` macro was invoked.
+///     }
+/// }
+///
+/// impl fmt::Display for Flags {
+///     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+///         write!(f, "hi!")
+///     }
+/// }
+///
+/// fn main() {
+///     let mut flags = FLAG_A | FLAG_B;
+///     flags.clear();
+///     assert!(flags.is_empty());
+///     assert_eq!(format!("{}", flags), "hi!");
+///     assert_eq!(format!("{:?}", FLAG_A | FLAG_B), "FLAG_A | FLAG_B");
+///     assert_eq!(format!("{:?}", FLAG_B), "FLAG_B");
+/// }
+/// ```
+///
+/// # Visibility
+///
+/// The generated struct and its associated flag constants are not exported
+/// out of the current module by default. A definition can be exported out of
+/// the current module by adding `pub` before `flags`:
+///
+/// ```{.rust},ignore
+/// #[macro_use]
+/// extern crate bitflags;
+///
+/// mod example {
+///     bitflags! {
+///         pub flags Flags1: u32 {
+///             const FLAG_A   = 0b00000001,
+///         }
+///     }
+///     bitflags! {
+///         flags Flags2: u32 {
+///             const FLAG_B   = 0b00000010,
+///         }
+///     }
+/// }
+///
+/// fn main() {
+///     let flag1 = example::FLAG_A;
+///     let flag2 = example::FLAG_B; // error: const `FLAG_B` is private
+/// }
+/// ```
+///
+/// # Attributes
+///
+/// Attributes can be attached to the generated `struct` by placing them
+/// before the `flags` keyword.
+///
+/// # Trait implementations
+///
+/// The `Copy`, `Clone`, `PartialEq`, `Eq`, `PartialOrd`, `Ord` and `Hash`
+/// traits automatically derived for the `struct` using the `derive` attribute.
+/// Additional traits can be derived by providing an explicit `derive`
+/// attribute on `flags`.
+///
+/// The `Extend` and `FromIterator` traits are implemented for the `struct`,
+/// too: `Extend` adds the union of the instances of the `struct` iterated over,
+/// while `FromIterator` calculates the union.
+///
+/// The `Debug` trait is also implemented by displaying the bits value of the
+/// internal struct.
+///
+/// ## Operators
+///
+/// The following operator traits are implemented for the generated `struct`:
+///
+/// - `BitOr` and `BitOrAssign`: union
+/// - `BitAnd` and `BitAndAssign`: intersection
+/// - `BitXor` and `BitXorAssign`: toggle
+/// - `Sub` and `SubAssign`: set difference
+/// - `Not`: set complement
+///
+/// As long as the assignment operators are unstable rust feature they are only
+/// available with the crate feature `assignment_ops` enabled.
+///
+/// # Methods
+///
+/// The following methods are defined for the generated `struct`:
+///
+/// - `empty`: an empty set of flags
+/// - `all`: the set of all flags
+/// - `bits`: the raw value of the flags currently stored
+/// - `from_bits`: convert from underlying bit representation, unless that
+///                representation contains bits that do not correspond to a flag
+/// - `from_bits_truncate`: convert from underlying bit representation, dropping
+///                         any bits that do not correspond to flags
+/// - `is_empty`: `true` if no flags are currently stored
+/// - `is_all`: `true` if all flags are currently set
+/// - `intersects`: `true` if there are flags common to both `self` and `other`
+/// - `contains`: `true` all of the flags in `other` are contained within `self`
+/// - `insert`: inserts the specified flags in-place
+/// - `remove`: removes the specified flags in-place
+/// - `toggle`: the specified flags will be inserted if not present, and removed
+///             if they are.
+#[macro_export]
+macro_rules! bitflags {
+    ($(#[$attr:meta])* pub flags $BitFlags:ident: $T:ty {
+        $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+
+    }) => {
+        #[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)]
+        $(#[$attr])*
+        pub struct $BitFlags {
+            bits: $T,
+        }
+
+        $($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
+
+        bitflags! {
+            @_impl flags $BitFlags: $T {
+                $($(#[$Flag_attr])* const $Flag = $value),+
+            }
+        }
+    };
+    ($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
+        $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+
+    }) => {
+        #[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)]
+        $(#[$attr])*
+        struct $BitFlags {
+            bits: $T,
+        }
+
+        $($(#[$Flag_attr])* const $Flag: $BitFlags = $BitFlags { bits: $value };)+
+
+        bitflags! {
+            @_impl flags $BitFlags: $T {
+                $($(#[$Flag_attr])* const $Flag = $value),+
+            }
+        }
+    };
+    (@_impl flags $BitFlags:ident: $T:ty {
+        $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+
+    }) => {
+        impl $crate::__core::fmt::Debug for $BitFlags {
+            fn fmt(&self, f: &mut $crate::__core::fmt::Formatter) -> $crate::__core::fmt::Result {
+                // This convoluted approach is to handle #[cfg]-based flag
+                // omission correctly. Some of the $Flag variants may not be
+                // defined in this module so we create an inner module which
+                // defines *all* flags to the value of 0. We then create a
+                // second inner module that defines all of the flags with #[cfg]
+                // to their real values. Afterwards the glob will import
+                // variants from the second inner module, shadowing all
+                // defined variants, leaving only the undefined ones with the
+                // bit value of 0.
+                #[allow(dead_code)]
+                #[allow(unused_assignments)]
+                mod dummy {
+                    // We can't use the real $BitFlags struct because it may be
+                    // private, which prevents us from using it to define
+                    // public constants.
+                    pub struct $BitFlags {
+                        bits: u64,
+                    }
+                    mod real_flags {
+                        use super::$BitFlags;
+                        $($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags {
+                            bits: super::super::$Flag.bits as u64
+                        };)+
+                    }
+                    // Now we define the "undefined" versions of the flags.
+                    // This way, all the names exist, even if some are #[cfg]ed
+                    // out.
+                    $(const $Flag: $BitFlags = $BitFlags { bits: 0 };)+
+
+                    #[inline]
+                    pub fn fmt(self_: u64,
+                               f: &mut $crate::__core::fmt::Formatter)
+                               -> $crate::__core::fmt::Result {
+                        // Now we import the real values for the flags.
+                        // Only ones that are #[cfg]ed out will be 0.
+                        use self::real_flags::*;
+
+                        let mut first = true;
+                        $(
+                            // $Flag.bits == 0 means that $Flag doesn't exist
+                            if $Flag.bits != 0 && self_ & $Flag.bits as u64 == $Flag.bits as u64 {
+                                if !first {
+                                    try!(f.write_str(" | "));
+                                }
+                                first = false;
+                                try!(f.write_str(stringify!($Flag)));
+                            }
+                        )+
+                        Ok(())
+                    }
+                }
+                dummy::fmt(self.bits as u64, f)
+            }
+        }
+
+        #[allow(dead_code)]
+        impl $BitFlags {
+            /// Returns an empty set of flags.
+            #[inline]
+            pub fn empty() -> $BitFlags {
+                $BitFlags { bits: 0 }
+            }
+
+            /// Returns the set containing all flags.
+            #[inline]
+            pub fn all() -> $BitFlags {
+                // See above `dummy` module for why this approach is taken.
+                #[allow(dead_code)]
+                mod dummy {
+                    pub struct $BitFlags {
+                        bits: u64,
+                    }
+                    mod real_flags {
+                        use super::$BitFlags;
+                        $($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags {
+                            bits: super::super::$Flag.bits as u64
+                        };)+
+                    }
+                    $(const $Flag: $BitFlags = $BitFlags { bits: 0 };)+
+
+                    #[inline]
+                    pub fn all() -> u64 {
+                        use self::real_flags::*;
+                        $($Flag.bits)|+
+                    }
+                }
+                $BitFlags { bits: dummy::all() as $T }
+            }
+
+            /// Returns the raw value of the flags currently stored.
+            #[inline]
+            pub fn bits(&self) -> $T {
+                self.bits
+            }
+
+            /// Convert from underlying bit representation, unless that
+            /// representation contains bits that do not correspond to a flag.
+            #[inline]
+            pub fn from_bits(bits: $T) -> $crate::__core::option::Option<$BitFlags> {
+                if (bits & !$BitFlags::all().bits()) == 0 {
+                    $crate::__core::option::Option::Some($BitFlags { bits: bits })
+                } else {
+                    $crate::__core::option::Option::None
+                }
+            }
+
+            /// Convert from underlying bit representation, dropping any bits
+            /// that do not correspond to flags.
+            #[inline]
+            pub fn from_bits_truncate(bits: $T) -> $BitFlags {
+                $BitFlags { bits: bits } & $BitFlags::all()
+            }
+
+            /// Returns `true` if no flags are currently stored.
+            #[inline]
+            pub fn is_empty(&self) -> bool {
+                *self == $BitFlags::empty()
+            }
+
+            /// Returns `true` if all flags are currently set.
+            #[inline]
+            pub fn is_all(&self) -> bool {
+                *self == $BitFlags::all()
+            }
+
+            /// Returns `true` if there are flags common to both `self` and `other`.
+            #[inline]
+            pub fn intersects(&self, other: $BitFlags) -> bool {
+                !(*self & other).is_empty()
+            }
+
+            /// Returns `true` all of the flags in `other` are contained within `self`.
+            #[inline]
+            pub fn contains(&self, other: $BitFlags) -> bool {
+                (*self & other) == other
+            }
+
+            /// Inserts the specified flags in-place.
+            #[inline]
+            pub fn insert(&mut self, other: $BitFlags) {
+                self.bits |= other.bits;
+            }
+
+            /// Removes the specified flags in-place.
+            #[inline]
+            pub fn remove(&mut self, other: $BitFlags) {
+                self.bits &= !other.bits;
+            }
+
+            /// Toggles the specified flags in-place.
+            #[inline]
+            pub fn toggle(&mut self, other: $BitFlags) {
+                self.bits ^= other.bits;
+            }
+        }
+
+        impl $crate::__core::ops::BitOr for $BitFlags {
+            type Output = $BitFlags;
+
+            /// Returns the union of the two sets of flags.
+            #[inline]
+            fn bitor(self, other: $BitFlags) -> $BitFlags {
+                $BitFlags { bits: self.bits | other.bits }
+            }
+        }
+
+        impl $crate::__core::ops::BitOrAssign for $BitFlags {
+
+            /// Adds the set of flags.
+            #[inline]
+            fn bitor_assign(&mut self, other: $BitFlags) {
+                self.bits |= other.bits;
+            }
+        }
+
+        impl $crate::__core::ops::BitXor for $BitFlags {
+            type Output = $BitFlags;
+
+            /// Returns the left flags, but with all the right flags toggled.
+            #[inline]
+            fn bitxor(self, other: $BitFlags) -> $BitFlags {
+                $BitFlags { bits: self.bits ^ other.bits }
+            }
+        }
+
+        impl $crate::__core::ops::BitXorAssign for $BitFlags {
+
+            /// Toggles the set of flags.
+            #[inline]
+            fn bitxor_assign(&mut self, other: $BitFlags) {
+                self.bits ^= other.bits;
+            }
+        }
+
+        impl $crate::__core::ops::BitAnd for $BitFlags {
+            type Output = $BitFlags;
+
+            /// Returns the intersection between the two sets of flags.
+            #[inline]
+            fn bitand(self, other: $BitFlags) -> $BitFlags {
+                $BitFlags { bits: self.bits & other.bits }
+            }
+        }
+
+        impl $crate::__core::ops::BitAndAssign for $BitFlags {
+
+            /// Disables all flags disabled in the set.
+            #[inline]
+            fn bitand_assign(&mut self, other: $BitFlags) {
+                self.bits &= other.bits;
+            }
+        }
+
+        impl $crate::__core::ops::Sub for $BitFlags {
+            type Output = $BitFlags;
+
+            /// Returns the set difference of the two sets of flags.
+            #[inline]
+            fn sub(self, other: $BitFlags) -> $BitFlags {
+                $BitFlags { bits: self.bits & !other.bits }
+            }
+        }
+
+        impl $crate::__core::ops::SubAssign for $BitFlags {
+
+            /// Disables all flags enabled in the set.
+            #[inline]
+            fn sub_assign(&mut self, other: $BitFlags) {
+                self.bits &= !other.bits;
+            }
+        }
+
+        impl $crate::__core::ops::Not for $BitFlags {
+            type Output = $BitFlags;
+
+            /// Returns the complement of this set of flags.
+            #[inline]
+            fn not(self) -> $BitFlags {
+                $BitFlags { bits: !self.bits } & $BitFlags::all()
+            }
+        }
+
+        impl $crate::__core::iter::Extend<$BitFlags> for $BitFlags {
+            fn extend<T: $crate::__core::iter::IntoIterator<Item=$BitFlags>>(&mut self, iterator: T) {
+                for item in iterator {
+                    self.insert(item)
+                }
+            }
+        }
+
+        impl $crate::__core::iter::FromIterator<$BitFlags> for $BitFlags {
+            fn from_iter<T: $crate::__core::iter::IntoIterator<Item=$BitFlags>>(iterator: T) -> $BitFlags {
+                let mut result = Self::empty();
+                result.extend(iterator);
+                result
+            }
+        }
+    };
+    ($(#[$attr:meta])* pub flags $BitFlags:ident: $T:ty {
+        $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+,
+    }) => {
+        bitflags! {
+            $(#[$attr])*
+            pub flags $BitFlags: $T {
+                $($(#[$Flag_attr])* const $Flag = $value),+
+            }
+        }
+    };
+    ($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
+        $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+,
+    }) => {
+        bitflags! {
+            $(#[$attr])*
+            flags $BitFlags: $T {
+                $($(#[$Flag_attr])* const $Flag = $value),+
+            }
+        }
+    };
+}
+
+#[cfg(test)]
+#[allow(non_upper_case_globals, dead_code)]
+mod tests {
+    use std::hash::{SipHasher, Hash, Hasher};
+
+    bitflags! {
+        #[doc = "> The first principle is that you must not fool yourself — and"]
+        #[doc = "> you are the easiest person to fool."]
+        #[doc = "> "]
+        #[doc = "> - Richard Feynman"]
+        flags Flags: u32 {
+            const FlagA       = 0b00000001,
+            #[doc = "<pcwalton> macros are way better at generating code than trans is"]
+            const FlagB       = 0b00000010,
+            const FlagC       = 0b00000100,
+            #[doc = "* cmr bed"]
+            #[doc = "* strcat table"]
+            #[doc = "<strcat> wait what?"]
+            const FlagABC     = FlagA.bits
+                               | FlagB.bits
+                               | FlagC.bits,
+        }
+    }
+
+    bitflags! {
+        flags _CfgFlags: u32 {
+            #[cfg(windows)]
+            const _CfgA = 0b01,
+            #[cfg(unix)]
+            const _CfgB = 0b01,
+            #[cfg(windows)]
+            const _CfgC = _CfgA.bits | 0b10,
+        }
+    }
+
+    bitflags! {
+        flags AnotherSetOfFlags: i8 {
+            const AnotherFlag = -1_i8,
+        }
+    }
+
+    #[test]
+    fn test_bits(){
+        assert_eq!(Flags::empty().bits(), 0b00000000);
+        assert_eq!(FlagA.bits(), 0b00000001);
+        assert_eq!(FlagABC.bits(), 0b00000111);
+
+        assert_eq!(AnotherSetOfFlags::empty().bits(), 0b00);
+        assert_eq!(AnotherFlag.bits(), !0_i8);
+    }
+
+    #[test]
+    fn test_from_bits() {
+        assert_eq!(Flags::from_bits(0), Some(Flags::empty()));
+        assert_eq!(Flags::from_bits(0b1), Some(FlagA));
+        assert_eq!(Flags::from_bits(0b10), Some(FlagB));
+        assert_eq!(Flags::from_bits(0b11), Some(FlagA | FlagB));
+        assert_eq!(Flags::from_bits(0b1000), None);
+
+        assert_eq!(AnotherSetOfFlags::from_bits(!0_i8), Some(AnotherFlag));
+    }
+
+    #[test]
+    fn test_from_bits_truncate() {
+        assert_eq!(Flags::from_bits_truncate(0), Flags::empty());
+        assert_eq!(Flags::from_bits_truncate(0b1), FlagA);
+        assert_eq!(Flags::from_bits_truncate(0b10), FlagB);
+        assert_eq!(Flags::from_bits_truncate(0b11), (FlagA | FlagB));
+        assert_eq!(Flags::from_bits_truncate(0b1000), Flags::empty());
+        assert_eq!(Flags::from_bits_truncate(0b1001), FlagA);
+
+        assert_eq!(AnotherSetOfFlags::from_bits_truncate(0_i8), AnotherSetOfFlags::empty());
+    }
+
+    #[test]
+    fn test_is_empty(){
+        assert!(Flags::empty().is_empty());
+        assert!(!FlagA.is_empty());
+        assert!(!FlagABC.is_empty());
+
+        assert!(!AnotherFlag.is_empty());
+    }
+
+    #[test]
+    fn test_is_all() {
+        assert!(Flags::all().is_all());
+        assert!(!FlagA.is_all());
+        assert!(FlagABC.is_all());
+
+        assert!(AnotherFlag.is_all());
+    }
+
+    #[test]
+    fn test_two_empties_do_not_intersect() {
+        let e1 = Flags::empty();
+        let e2 = Flags::empty();
+        assert!(!e1.intersects(e2));
+
+        assert!(AnotherFlag.intersects(AnotherFlag));
+    }
+
+    #[test]
+    fn test_empty_does_not_intersect_with_full() {
+        let e1 = Flags::empty();
+        let e2 = FlagABC;
+        assert!(!e1.intersects(e2));
+    }
+
+    #[test]
+    fn test_disjoint_intersects() {
+        let e1 = FlagA;
+        let e2 = FlagB;
+        assert!(!e1.intersects(e2));
+    }
+
+    #[test]
+    fn test_overlapping_intersects() {
+        let e1 = FlagA;
+        let e2 = FlagA | FlagB;
+        assert!(e1.intersects(e2));
+    }
+
+    #[test]
+    fn test_contains() {
+        let e1 = FlagA;
+        let e2 = FlagA | FlagB;
+        assert!(!e1.contains(e2));
+        assert!(e2.contains(e1));
+        assert!(FlagABC.contains(e2));
+
+        assert!(AnotherFlag.contains(AnotherFlag));
+    }
+
+    #[test]
+    fn test_insert(){
+        let mut e1 = FlagA;
+        let e2 = FlagA | FlagB;
+        e1.insert(e2);
+        assert_eq!(e1, e2);
+
+        let mut e3 = AnotherSetOfFlags::empty();
+        e3.insert(AnotherFlag);
+        assert_eq!(e3, AnotherFlag);
+    }
+
+    #[test]
+    fn test_remove(){
+        let mut e1 = FlagA | FlagB;
+        let e2 = FlagA | FlagC;
+        e1.remove(e2);
+        assert_eq!(e1, FlagB);
+
+        let mut e3 = AnotherFlag;
+        e3.remove(AnotherFlag);
+        assert_eq!(e3, AnotherSetOfFlags::empty());
+    }
+
+    #[test]
+    fn test_operators() {
+        let e1 = FlagA | FlagC;
+        let e2 = FlagB | FlagC;
+        assert_eq!((e1 | e2), FlagABC);     // union
+        assert_eq!((e1 & e2), FlagC);       // intersection
+        assert_eq!((e1 - e2), FlagA);       // set difference
+        assert_eq!(!e2, FlagA);             // set complement
+        assert_eq!(e1 ^ e2, FlagA | FlagB); // toggle
+        let mut e3 = e1;
+        e3.toggle(e2);
+        assert_eq!(e3, FlagA | FlagB);
+
+        let mut m4 = AnotherSetOfFlags::empty();
+        m4.toggle(AnotherSetOfFlags::empty());
+        assert_eq!(m4, AnotherSetOfFlags::empty());
+    }
+
+    #[test]
+    fn test_assignment_operators() {
+        let mut m1 = Flags::empty();
+        let e1 = FlagA | FlagC;
+        // union
+        m1 |= FlagA;
+        assert_eq!(m1, FlagA);
+        // intersection
+        m1 &= e1;
+        assert_eq!(m1, FlagA);
+        // set difference
+        m1 -= m1;
+        assert_eq!(m1, Flags::empty());
+        // toggle
+        m1 ^= e1;
+        assert_eq!(m1, e1);
+    }
+
+    #[test]
+    fn test_extend() {
+        let mut flags;
+
+        flags = Flags::empty();
+        flags.extend([].iter().cloned());
+        assert_eq!(flags, Flags::empty());
+
+        flags = Flags::empty();
+        flags.extend([FlagA, FlagB].iter().cloned());
+        assert_eq!(flags, FlagA | FlagB);
+
+        flags = FlagA;
+        flags.extend([FlagA, FlagB].iter().cloned());
+        assert_eq!(flags, FlagA | FlagB);
+
+        flags = FlagB;
+        flags.extend([FlagA, FlagABC].iter().cloned());
+        assert_eq!(flags, FlagABC);
+    }
+
+    #[test]
+    fn test_from_iterator() {
+        assert_eq!([].iter().cloned().collect::<Flags>(), Flags::empty());
+        assert_eq!([FlagA, FlagB].iter().cloned().collect::<Flags>(), FlagA | FlagB);
+        assert_eq!([FlagA, FlagABC].iter().cloned().collect::<Flags>(), FlagABC);
+    }
+
+    #[test]
+    fn test_lt() {
+        let mut a = Flags::empty();
+        let mut b = Flags::empty();
+
+        assert!(!(a < b) && !(b < a));
+        b = FlagB;
+        assert!(a < b);
+        a = FlagC;
+        assert!(!(a < b) && b < a);
+        b = FlagC | FlagB;
+        assert!(a < b);
+    }
+
+    #[test]
+    fn test_ord() {
+        let mut a = Flags::empty();
+        let mut b = Flags::empty();
+
+        assert!(a <= b && a >= b);
+        a = FlagA;
+        assert!(a > b && a >= b);
+        assert!(b < a && b <= a);
+        b = FlagB;
+        assert!(b > a && b >= a);
+        assert!(a < b && a <= b);
+    }
+
+    fn hash<T: Hash>(t: &T) -> u64 {
+        let mut s = SipHasher::new_with_keys(0, 0);
+        t.hash(&mut s);
+        s.finish()
+    }
+
+    #[test]
+    fn test_hash() {
+        let mut x = Flags::empty();
+        let mut y = Flags::empty();
+        assert_eq!(hash(&x), hash(&y));
+        x = Flags::all();
+        y = FlagABC;
+        assert_eq!(hash(&x), hash(&y));
+    }
+
+    #[test]
+    fn test_debug() {
+        assert_eq!(format!("{:?}", FlagA | FlagB), "FlagA | FlagB");
+        assert_eq!(format!("{:?}", FlagABC), "FlagA | FlagB | FlagC | FlagABC");
+    }
+
+    mod submodule {
+        bitflags! {
+            pub flags PublicFlags: i8 {
+                const FlagX = 0,
+            }
+        }
+        bitflags! {
+            flags PrivateFlags: i8 {
+                const FlagY = 0,
+            }
+        }
+
+        #[test]
+        fn test_private() {
+            let _ = FlagY;
+        }
+    }
+
+    #[test]
+    fn test_public() {
+        let _ = submodule::FlagX;
+    }
+
+    mod t1 {
+        mod foo {
+            pub type Bar = i32;
+        }
+
+        bitflags! {
+            /// baz
+            flags Flags: foo::Bar {
+                const A       = 0b00000001,
+                #[cfg(foo)]
+                const B       = 0b00000010,
+                #[cfg(foo)]
+                const C       = 0b00000010,
+            }
+        }
+    }
+}
diff --git a/vendor/bitflags-0.7.0/tests/external.rs b/vendor/bitflags-0.7.0/tests/external.rs
new file mode 100644
index 0000000..0f0c7f6
--- /dev/null
+++ b/vendor/bitflags-0.7.0/tests/external.rs
@@ -0,0 +1,21 @@
+#![allow(dead_code)]
+
+#[macro_use]
+extern crate bitflags;
+
+bitflags! {
+    /// baz
+    flags Flags: u32 {
+        const A       = 0b00000001,
+        #[doc = "bar"]
+        const B       = 0b00000010,
+        const C       = 0b00000100,
+        #[doc = "foo"]
+        const ABC     = A.bits | B.bits | C.bits,
+    }
+}
+
+#[test]
+fn smoke() {
+    assert_eq!(ABC, A | B | C);
+}
diff --git a/vendor/bitflags-0.7.0/tests/external_no_std.rs b/vendor/bitflags-0.7.0/tests/external_no_std.rs
new file mode 100644
index 0000000..46526fd
--- /dev/null
+++ b/vendor/bitflags-0.7.0/tests/external_no_std.rs
@@ -0,0 +1,22 @@
+#![allow(dead_code)]
+#![no_std]
+
+#[macro_use]
+extern crate bitflags;
+
+bitflags! {
+    /// baz
+    flags Flags: u32 {
+        const A       = 0b00000001,
+        #[doc = "bar"]
+        const B       = 0b00000010,
+        const C       = 0b00000100,
+        #[doc = "foo"]
+        const ABC     = A.bits | B.bits | C.bits,
+    }
+}
+
+#[test]
+fn smoke() {
+    assert_eq!(ABC, A | B | C);
+}
diff --git a/vendor/byteorder-0.5.3/.cargo-checksum.json b/vendor/byteorder-0.5.3/.cargo-checksum.json
new file mode 100644
index 0000000..88feac2
--- /dev/null
+++ b/vendor/byteorder-0.5.3/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"2879af3c0512f976015d532e2d768f04ff22fdcf8745b69b955b78fda321c3fb",".travis.yml":"81545ce3c6c72111a68434464c3f9fa8df9cbe39759a081fac527628ab21ae0c","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"a7282931b50dff2e463f82baaed95a9d76636bc0fef3e921acd8ca69eab32b83","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","Makefile":"a45a128685a2ae7d4fa39d310786674417ee113055ef290a11f88002285865fc","README.md":"fbcc46b6d0a585096737f50922818b59016b69d959b05f1b29863b2af8e4da43","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","benches/bench.rs":"f583692d829c8dfe19b1d5b9e968ccf5c74d6733367ca183edff74041a6afedd","session.vim":"95cb1d7caf0ff7fbe76ec911988d908ddd883381c925ba64b537695bc9f021c4","src/lib.rs":"ef9e7a218fa3a4912c47f6840d32b975940d98277b6c9be85e8d7d045552eb87","src/new.rs":"161c21b7ebb5668c7cc70b46b0eb37709e06bb9c854f2fdfc6ce3d3babcbf3de"},"package":"0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"}
\ No newline at end of file
diff --git a/vendor/byteorder-0.5.3/.cargo-ok b/vendor/byteorder-0.5.3/.cargo-ok
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vendor/byteorder-0.5.3/.cargo-ok
diff --git a/vendor/byteorder-0.5.3/.gitignore b/vendor/byteorder-0.5.3/.gitignore
new file mode 100644
index 0000000..1fec0ef
--- /dev/null
+++ b/vendor/byteorder-0.5.3/.gitignore
@@ -0,0 +1,6 @@
+.*.swp
+doc
+tags
+build
+target
+Cargo.lock
diff --git a/vendor/byteorder-0.5.3/.travis.yml b/vendor/byteorder-0.5.3/.travis.yml
new file mode 100644
index 0000000..d6a2793
--- /dev/null
+++ b/vendor/byteorder-0.5.3/.travis.yml
@@ -0,0 +1,15 @@
+language: rust
+matrix:
+  include:
+    - rust: "nightly"
+      env: TEST_SUITE=suite_nightly
+    - rust: "beta"
+      env: TEST_SUITE=suite_beta
+    - rust: "stable"
+      env: TEST_SUITE=suite_stable
+script:
+  - cargo build --verbose
+  - cargo test --verbose
+  - if [ "$TEST_SUITE" = "suite_nightly" ]; then
+      cargo bench --verbose;
+    fi
diff --git a/vendor/byteorder-0.5.3/COPYING b/vendor/byteorder-0.5.3/COPYING
new file mode 100644
index 0000000..bb9c20a
--- /dev/null
+++ b/vendor/byteorder-0.5.3/COPYING
@@ -0,0 +1,3 @@
+This project is dual-licensed under the Unlicense and MIT licenses.
+
+You may use this code under the terms of either license.
diff --git a/vendor/byteorder-0.5.3/Cargo.toml b/vendor/byteorder-0.5.3/Cargo.toml
new file mode 100644
index 0000000..32894e6
--- /dev/null
+++ b/vendor/byteorder-0.5.3/Cargo.toml
@@ -0,0 +1,25 @@
+[package]
+name = "byteorder"
+version = "0.5.3"  #:version
+authors = ["Andrew Gallant <jamslam@gmail.com>"]
+description = "Library for reading/writing numbers in big-endian and little-endian."
+documentation = "http://burntsushi.net/rustdoc/byteorder/"
+homepage = "https://github.com/BurntSushi/byteorder"
+repository = "https://github.com/BurntSushi/byteorder"
+readme = "README.md"
+keywords = ["byte", "endian", "big-endian", "little-endian", "binary"]
+license = "Unlicense/MIT"
+
+[lib]
+name = "byteorder"
+
+[dev-dependencies]
+quickcheck = "0.2"
+rand = "0.3"
+
+[features]
+default = ["std"]
+std = []
+
+[profile.bench]
+opt-level = 3
diff --git a/vendor/byteorder-0.5.3/LICENSE-MIT b/vendor/byteorder-0.5.3/LICENSE-MIT
new file mode 100644
index 0000000..3b0a5dc
--- /dev/null
+++ b/vendor/byteorder-0.5.3/LICENSE-MIT
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Andrew Gallant
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/byteorder-0.5.3/Makefile b/vendor/byteorder-0.5.3/Makefile
new file mode 100644
index 0000000..9f956f4
--- /dev/null
+++ b/vendor/byteorder-0.5.3/Makefile
@@ -0,0 +1,14 @@
+all:
+	echo Nothing to do...
+
+ctags:
+	ctags --recurse --options=ctags.rust --languages=Rust
+
+docs:
+	cargo doc
+	in-dir ./target/doc fix-perms
+	rscp ./target/doc/* gopher:~/www/burntsushi.net/rustdoc/
+
+push:
+	git push origin master
+	git push github master
diff --git a/vendor/byteorder-0.5.3/README.md b/vendor/byteorder-0.5.3/README.md
new file mode 100644
index 0000000..5640f3e
--- /dev/null
+++ b/vendor/byteorder-0.5.3/README.md
@@ -0,0 +1,59 @@
+This crate provides convenience methods for encoding and decoding numbers in
+either big-endian or little-endian order. This is meant to replace the old
+methods defined on the standard library `Reader` and `Writer` traits.
+
+[![Build status](https://api.travis-ci.org/BurntSushi/byteorder.png)](https://travis-ci.org/BurntSushi/byteorder)
+[![](http://meritbadge.herokuapp.com/byteorder)](https://crates.io/crates/byteorder)
+
+Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org).
+
+
+### Documentation
+
+[http://burntsushi.net/rustdoc/byteorder/](http://burntsushi.net/rustdoc/byteorder/).
+
+The documentation includes examples.
+
+
+### Installation
+
+This crate works with Cargo and is on
+[crates.io](https://crates.io/crates/byteorder). The package is regularly
+updated.  Add it to your `Cargo.toml` like so:
+
+```toml
+[dependencies]
+byteorder = "0.5"
+```
+
+If you want to augment existing `Read` and `Write` traits, then import the
+extension methods like so:
+
+```rust
+extern crate byteorder;
+
+use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian};
+```
+
+For example:
+
+```rust
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+// Note that we use type parameters to indicate which kind of byte order
+// we want!
+assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+```
+
+### `no_std` crates
+
+This crate has a feature, `std`, that is enabled by default. To use this crate
+in a `no_std` context, add the following to your `Cargo.toml`:
+
+```toml
+[dependencies]
+byteorder = { version = "0.5", default-features = false }
+```
diff --git a/vendor/byteorder-0.5.3/UNLICENSE b/vendor/byteorder-0.5.3/UNLICENSE
new file mode 100644
index 0000000..68a49da
--- /dev/null
+++ b/vendor/byteorder-0.5.3/UNLICENSE
@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org/>
diff --git a/vendor/byteorder-0.5.3/benches/bench.rs b/vendor/byteorder-0.5.3/benches/bench.rs
new file mode 100644
index 0000000..51d57b3
--- /dev/null
+++ b/vendor/byteorder-0.5.3/benches/bench.rs
@@ -0,0 +1,148 @@
+#![feature(test)]
+
+extern crate byteorder;
+extern crate test;
+
+macro_rules! bench_num {
+    ($name:ident, $read:ident, $bytes:expr, $data:expr) => (
+        mod $name {
+            use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian};
+            use super::test::Bencher;
+            use super::test::black_box as bb;
+
+            const NITER: usize = 100_000;
+
+            #[bench]
+            fn read_big_endian(b: &mut Bencher) {
+                let buf = $data;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(BigEndian::$read(&buf, $bytes));
+                    }
+                });
+            }
+
+            #[bench]
+            fn read_little_endian(b: &mut Bencher) {
+                let buf = $data;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(LittleEndian::$read(&buf, $bytes));
+                    }
+                });
+            }
+
+            #[bench]
+            fn read_native_endian(b: &mut Bencher) {
+                let buf = $data;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(NativeEndian::$read(&buf, $bytes));
+                    }
+                });
+            }
+        }
+    );
+    ($ty:ident, $max:ident,
+     $read:ident, $write:ident, $size:expr, $data:expr) => (
+        mod $ty {
+            use std::$ty;
+            use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian};
+            use super::test::Bencher;
+            use super::test::black_box as bb;
+
+            const NITER: usize = 100_000;
+
+            #[bench]
+            fn read_big_endian(b: &mut Bencher) {
+                let buf = $data;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(BigEndian::$read(&buf));
+                    }
+                });
+            }
+
+            #[bench]
+            fn read_little_endian(b: &mut Bencher) {
+                let buf = $data;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(LittleEndian::$read(&buf));
+                    }
+                });
+            }
+
+            #[bench]
+            fn read_native_endian(b: &mut Bencher) {
+                let buf = $data;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(NativeEndian::$read(&buf));
+                    }
+                });
+            }
+
+            #[bench]
+            fn write_big_endian(b: &mut Bencher) {
+                let mut buf = $data;
+                let n = $ty::$max;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(BigEndian::$write(&mut buf, n));
+                    }
+                });
+            }
+
+            #[bench]
+            fn write_little_endian(b: &mut Bencher) {
+                let mut buf = $data;
+                let n = $ty::$max;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(LittleEndian::$write(&mut buf, n));
+                    }
+                });
+            }
+
+            #[bench]
+            fn write_native_endian(b: &mut Bencher) {
+                let mut buf = $data;
+                let n = $ty::$max;
+                b.iter(|| {
+                    for _ in 0..NITER {
+                        bb(NativeEndian::$write(&mut buf, n));
+                    }
+                });
+            }
+        }
+    );
+}
+
+bench_num!(u16, MAX, read_u16, write_u16, 2, [1, 2]);
+bench_num!(i16, MAX, read_i16, write_i16, 2, [1, 2]);
+bench_num!(u32, MAX, read_u32, write_u32, 4, [1, 2, 3, 4]);
+bench_num!(i32, MAX, read_i32, write_i32, 4, [1, 2, 3, 4]);
+bench_num!(u64, MAX, read_u64, write_u64, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
+bench_num!(i64, MAX, read_i64, write_i64, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
+bench_num!(f32, MAX, read_f32, write_f32, 4, [1, 2, 3, 4]);
+bench_num!(f64, MAX, read_f64, write_f64, 8,
+           [1, 2, 3, 4, 5, 6, 7, 8]);
+
+bench_num!(uint_1, read_uint, 1, [1]);
+bench_num!(uint_2, read_uint, 2, [1, 2]);
+bench_num!(uint_3, read_uint, 3, [1, 2, 3]);
+bench_num!(uint_4, read_uint, 4, [1, 2, 3, 4]);
+bench_num!(uint_5, read_uint, 5, [1, 2, 3, 4, 5]);
+bench_num!(uint_6, read_uint, 6, [1, 2, 3, 4, 5, 6]);
+bench_num!(uint_7, read_uint, 7, [1, 2, 3, 4, 5, 6, 7]);
+bench_num!(uint_8, read_uint, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
+
+bench_num!(int_1, read_int, 1, [1]);
+bench_num!(int_2, read_int, 2, [1, 2]);
+bench_num!(int_3, read_int, 3, [1, 2, 3]);
+bench_num!(int_4, read_int, 4, [1, 2, 3, 4]);
+bench_num!(int_5, read_int, 5, [1, 2, 3, 4, 5]);
+bench_num!(int_6, read_int, 6, [1, 2, 3, 4, 5, 6]);
+bench_num!(int_7, read_int, 7, [1, 2, 3, 4, 5, 6, 7]);
+bench_num!(int_8, read_int, 8, [1, 2, 3, 4, 5, 6, 7, 8]);
diff --git a/vendor/byteorder-0.5.3/session.vim b/vendor/byteorder-0.5.3/session.vim
new file mode 100644
index 0000000..213c956
--- /dev/null
+++ b/vendor/byteorder-0.5.3/session.vim
@@ -0,0 +1 @@
+au BufWritePost *.rs silent!make ctags > /dev/null 2>&1
diff --git a/vendor/byteorder-0.5.3/src/lib.rs b/vendor/byteorder-0.5.3/src/lib.rs
new file mode 100644
index 0000000..a25bab6
--- /dev/null
+++ b/vendor/byteorder-0.5.3/src/lib.rs
@@ -0,0 +1,802 @@
+/*!
+This crate provides convenience methods for encoding and decoding numbers
+in either big-endian or little-endian order.
+
+The organization of the crate is pretty simple. A trait, `ByteOrder`, specifies
+byte conversion methods for each type of number in Rust (sans numbers that have
+a platform dependent size like `usize` and `isize`). Two types, `BigEndian`
+and `LittleEndian` implement these methods. Finally, `ReadBytesExt` and
+`WriteBytesExt` provide convenience methods available to all types that
+implement `Read` and `Write`.
+
+# Examples
+
+Read unsigned 16 bit big-endian integers from a `Read` type:
+
+```rust
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+// Note that we use type parameters to indicate which kind of byte order
+// we want!
+assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+```
+
+Write unsigned 16 bit little-endian integers to a `Write` type:
+
+```rust
+use byteorder::{LittleEndian, WriteBytesExt};
+
+let mut wtr = vec![];
+wtr.write_u16::<LittleEndian>(517).unwrap();
+wtr.write_u16::<LittleEndian>(768).unwrap();
+assert_eq!(wtr, vec![5, 2, 0, 3]);
+```
+*/
+
+#![crate_name = "byteorder"]
+#![doc(html_root_url = "http://burntsushi.net/rustdoc/byteorder")]
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#![deny(missing_docs)]
+
+#[cfg(feature = "std")]
+extern crate core;
+
+use core::mem::transmute;
+use core::ptr::copy_nonoverlapping;
+
+#[cfg(feature = "std")]
+pub use new::{ReadBytesExt, WriteBytesExt};
+
+#[cfg(feature = "std")]
+mod new;
+
+#[inline]
+fn extend_sign(val: u64, nbytes: usize) -> i64 {
+    let shift = (8 - nbytes) * 8;
+    (val << shift) as i64 >> shift
+}
+
+#[inline]
+fn unextend_sign(val: i64, nbytes: usize) -> u64 {
+    let shift = (8 - nbytes) * 8;
+    (val << shift) as u64 >> shift
+}
+
+#[inline]
+fn pack_size(n: u64) -> usize {
+    if n < 1 << 8 {
+        1
+    } else if n < 1 << 16 {
+        2
+    } else if n < 1 << 24 {
+        3
+    } else if n < 1 << 32 {
+        4
+    } else if n < 1 << 40 {
+        5
+    } else if n < 1 << 48 {
+        6
+    } else if n < 1 << 56 {
+        7
+    } else {
+        8
+    }
+}
+
+/// ByteOrder describes types that can serialize integers as bytes.
+///
+/// Note that `Self` does not appear anywhere in this trait's definition!
+/// Therefore, in order to use it, you'll need to use syntax like
+/// `T::read_u16(&[0, 1])` where `T` implements `ByteOrder`.
+///
+/// This crate provides two types that implement `ByteOrder`: `BigEndian`
+/// and `LittleEndian`.
+///
+/// # Examples
+///
+/// Write and read `u32` numbers in little endian order:
+///
+/// ```rust
+/// use byteorder::{ByteOrder, LittleEndian};
+///
+/// let mut buf = [0; 4];
+/// LittleEndian::write_u32(&mut buf, 1_000_000);
+/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+/// ```
+///
+/// Write and read `i16` numbers in big endian order:
+///
+/// ```rust
+/// use byteorder::{ByteOrder, BigEndian};
+///
+/// let mut buf = [0; 2];
+/// BigEndian::write_i16(&mut buf, -50_000);
+/// assert_eq!(-50_000, BigEndian::read_i16(&buf));
+/// ```
+pub trait ByteOrder {
+    /// Reads an unsigned 16 bit integer from `buf`.
+    ///
+    /// Panics when `buf.len() < 2`.
+    fn read_u16(buf: &[u8]) -> u16;
+
+    /// Reads an unsigned 32 bit integer from `buf`.
+    ///
+    /// Panics when `buf.len() < 4`.
+    fn read_u32(buf: &[u8]) -> u32;
+
+    /// Reads an unsigned 64 bit integer from `buf`.
+    ///
+    /// Panics when `buf.len() < 8`.
+    fn read_u64(buf: &[u8]) -> u64;
+
+    /// Reads an unsigned n-bytes integer from `buf`.
+    ///
+    /// Panics when `nbytes < 1` or `nbytes > 8` or
+    /// `buf.len() < nbytes`
+    fn read_uint(buf: &[u8], nbytes: usize) -> u64;
+
+    /// Writes an unsigned 16 bit integer `n` to `buf`.
+    ///
+    /// Panics when `buf.len() < 2`.
+    fn write_u16(buf: &mut [u8], n: u16);
+
+    /// Writes an unsigned 32 bit integer `n` to `buf`.
+    ///
+    /// Panics when `buf.len() < 4`.
+    fn write_u32(buf: &mut [u8], n: u32);
+
+    /// Writes an unsigned 64 bit integer `n` to `buf`.
+    ///
+    /// Panics when `buf.len() < 8`.
+    fn write_u64(buf: &mut [u8], n: u64);
+
+    /// Writes an unsigned integer `n` to `buf` using only `nbytes`.
+    ///
+    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
+    /// this method panics.
+    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize);
+
+    /// Reads a signed 16 bit integer from `buf`.
+    ///
+    /// Panics when `buf.len() < 2`.
+    #[inline]
+    fn read_i16(buf: &[u8]) -> i16 {
+        Self::read_u16(buf) as i16
+    }
+
+    /// Reads a signed 32 bit integer from `buf`.
+    ///
+    /// Panics when `buf.len() < 4`.
+    #[inline]
+    fn read_i32(buf: &[u8]) -> i32 {
+        Self::read_u32(buf) as i32
+    }
+
+    /// Reads a signed 64 bit integer from `buf`.
+    ///
+    /// Panics when `buf.len() < 8`.
+    #[inline]
+    fn read_i64(buf: &[u8]) -> i64 {
+        Self::read_u64(buf) as i64
+    }
+
+    /// Reads a signed n-bytes integer from `buf`.
+    ///
+    /// Panics when `nbytes < 1` or `nbytes > 8` or
+    /// `buf.len() < nbytes`
+    #[inline]
+    fn read_int(buf: &[u8], nbytes: usize) -> i64 {
+        extend_sign(Self::read_uint(buf, nbytes), nbytes)
+    }
+
+    /// Reads a IEEE754 single-precision (4 bytes) floating point number.
+    ///
+    /// Panics when `buf.len() < 4`.
+    #[inline]
+    fn read_f32(buf: &[u8]) -> f32 {
+        unsafe { transmute(Self::read_u32(buf)) }
+    }
+
+    /// Reads a IEEE754 double-precision (8 bytes) floating point number.
+    ///
+    /// Panics when `buf.len() < 8`.
+    #[inline]
+    fn read_f64(buf: &[u8]) -> f64 {
+        unsafe { transmute(Self::read_u64(buf)) }
+    }
+
+    /// Writes a signed 16 bit integer `n` to `buf`.
+    ///
+    /// Panics when `buf.len() < 2`.
+    #[inline]
+    fn write_i16(buf: &mut [u8], n: i16) {
+        Self::write_u16(buf, n as u16)
+    }
+
+    /// Writes a signed 32 bit integer `n` to `buf`.
+    ///
+    /// Panics when `buf.len() < 4`.
+    #[inline]
+    fn write_i32(buf: &mut [u8], n: i32) {
+        Self::write_u32(buf, n as u32)
+    }
+
+    /// Writes a signed 64 bit integer `n` to `buf`.
+    ///
+    /// Panics when `buf.len() < 8`.
+    #[inline]
+    fn write_i64(buf: &mut [u8], n: i64) {
+        Self::write_u64(buf, n as u64)
+    }
+
+    /// Writes a signed integer `n` to `buf` using only `nbytes`.
+    ///
+    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
+    /// this method panics.
+    #[inline]
+    fn write_int(buf: &mut [u8], n: i64, nbytes: usize) {
+        Self::write_uint(buf, unextend_sign(n, nbytes), nbytes)
+    }
+
+    /// Writes a IEEE754 single-precision (4 bytes) floating point number.
+    ///
+    /// Panics when `buf.len() < 4`.
+    #[inline]
+    fn write_f32(buf: &mut [u8], n: f32) {
+        Self::write_u32(buf, unsafe { transmute(n) })
+    }
+
+    /// Writes a IEEE754 double-precision (8 bytes) floating point number.
+    ///
+    /// Panics when `buf.len() < 8`.
+    #[inline]
+    fn write_f64(buf: &mut [u8], n: f64) {
+        Self::write_u64(buf, unsafe { transmute(n) })
+    }
+}
+
+/// Defines big-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+#[allow(missing_copy_implementations)] pub enum BigEndian {}
+
+/// Defines little-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+#[allow(missing_copy_implementations)] pub enum LittleEndian {}
+
+/// Defines network byte order serialization.
+///
+/// Network byte order is defined by [RFC 1700][1] to be big-endian, and is
+/// referred to in several protocol specifications.  This type is an alias of
+/// BigEndian.
+///
+/// [1]: https://tools.ietf.org/html/rfc1700
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+pub type NetworkEndian = BigEndian;
+
+/// Defines system native-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+#[cfg(target_endian = "little")]
+pub type NativeEndian = LittleEndian;
+
+/// Defines system native-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+#[cfg(target_endian = "big")]
+pub type NativeEndian = BigEndian;
+
+macro_rules! read_num_bytes {
+    ($ty:ty, $size:expr, $src:expr, $which:ident) => ({
+        assert!($size == ::core::mem::size_of::<$ty>());
+        assert!($size <= $src.len());
+        let mut data: $ty = 0;
+        unsafe {
+            copy_nonoverlapping(
+                $src.as_ptr(),
+                &mut data as *mut $ty as *mut u8,
+                $size);
+        }
+        data.$which()
+    });
+}
+
+macro_rules! write_num_bytes {
+    ($ty:ty, $size:expr, $n:expr, $dst:expr, $which:ident) => ({
+        assert!($size <= $dst.len());
+        unsafe {
+            // N.B. https://github.com/rust-lang/rust/issues/22776
+            let bytes = transmute::<_, [u8; $size]>($n.$which());
+            copy_nonoverlapping((&bytes).as_ptr(), $dst.as_mut_ptr(), $size);
+        }
+    });
+}
+
+impl ByteOrder for BigEndian {
+    #[inline]
+    fn read_u16(buf: &[u8]) -> u16 {
+        read_num_bytes!(u16, 2, buf, to_be)
+    }
+
+    #[inline]
+    fn read_u32(buf: &[u8]) -> u32 {
+        read_num_bytes!(u32, 4, buf, to_be)
+    }
+
+    #[inline]
+    fn read_u64(buf: &[u8]) -> u64 {
+        read_num_bytes!(u64, 8, buf, to_be)
+    }
+
+    #[inline]
+    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
+        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
+        let mut out = [0u8; 8];
+        let ptr_out = out.as_mut_ptr();
+        unsafe {
+            copy_nonoverlapping(
+                buf.as_ptr(), ptr_out.offset((8 - nbytes) as isize), nbytes);
+            (*(ptr_out as *const u64)).to_be()
+        }
+    }
+
+    #[inline]
+    fn write_u16(buf: &mut [u8], n: u16) {
+        write_num_bytes!(u16, 2, n, buf, to_be);
+    }
+
+    #[inline]
+    fn write_u32(buf: &mut [u8], n: u32) {
+        write_num_bytes!(u32, 4, n, buf, to_be);
+    }
+
+    #[inline]
+    fn write_u64(buf: &mut [u8], n: u64) {
+        write_num_bytes!(u64, 8, n, buf, to_be);
+    }
+
+    #[inline]
+    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
+        assert!(pack_size(n) <= nbytes && nbytes <= 8);
+        assert!(nbytes <= buf.len());
+        unsafe {
+            let bytes: [u8; 8] = transmute(n.to_be());
+            copy_nonoverlapping(
+                bytes.as_ptr().offset((8 - nbytes) as isize),
+                buf.as_mut_ptr(),
+                nbytes);
+        }
+    }
+}
+
+impl ByteOrder for LittleEndian {
+    #[inline]
+    fn read_u16(buf: &[u8]) -> u16 {
+        read_num_bytes!(u16, 2, buf, to_le)
+    }
+
+    #[inline]
+    fn read_u32(buf: &[u8]) -> u32 {
+        read_num_bytes!(u32, 4, buf, to_le)
+    }
+
+    #[inline]
+    fn read_u64(buf: &[u8]) -> u64 {
+        read_num_bytes!(u64, 8, buf, to_le)
+    }
+
+    #[inline]
+    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
+        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
+        let mut out = [0u8; 8];
+        let ptr_out = out.as_mut_ptr();
+        unsafe {
+            copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes);
+            (*(ptr_out as *const u64)).to_le()
+        }
+    }
+
+    #[inline]
+    fn write_u16(buf: &mut [u8], n: u16) {
+        write_num_bytes!(u16, 2, n, buf, to_le);
+    }
+
+    #[inline]
+    fn write_u32(buf: &mut [u8], n: u32) {
+        write_num_bytes!(u32, 4, n, buf, to_le);
+    }
+
+    #[inline]
+    fn write_u64(buf: &mut [u8], n: u64) {
+        write_num_bytes!(u64, 8, n, buf, to_le);
+    }
+
+    #[inline]
+    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
+        assert!(pack_size(n as u64) <= nbytes && nbytes <= 8);
+        assert!(nbytes <= buf.len());
+        unsafe {
+            let bytes: [u8; 8] = transmute(n.to_le());
+            copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes);
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    extern crate quickcheck;
+    extern crate rand;
+
+    use test::rand::thread_rng;
+    use test::quickcheck::{QuickCheck, StdGen, Testable};
+
+    const U64_MAX: u64 = ::std::u64::MAX;
+    const I64_MAX: u64 = ::std::i64::MAX as u64;
+
+    fn qc_sized<A: Testable>(f: A, size: u64) {
+        QuickCheck::new()
+            .gen(StdGen::new(thread_rng(), size as usize))
+            .tests(1_00)
+            .max_tests(10_000)
+            .quickcheck(f);
+    }
+
+    macro_rules! qc_byte_order {
+        ($name:ident, $ty_int:ident, $max:expr,
+         $bytes:expr, $read:ident, $write:ident) => (
+            mod $name {
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+                use super::qc_sized;
+
+                #[test]
+                fn big_endian() {
+                    let max = ($max - 1) >> (8 * (8 - $bytes));
+                    fn prop(n: $ty_int) -> bool {
+                        let mut buf = [0; 8];
+                        BigEndian::$write(&mut buf, n, $bytes);
+                        n == BigEndian::$read(&mut buf[..$bytes], $bytes)
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, max);
+                }
+
+                #[test]
+                fn little_endian() {
+                    let max = ($max - 1) >> (8 * (8 - $bytes));
+                    fn prop(n: $ty_int) -> bool {
+                        let mut buf = [0; 8];
+                        LittleEndian::$write(&mut buf, n, $bytes);
+                        n == LittleEndian::$read(&mut buf[..$bytes], $bytes)
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, max);
+                }
+
+                #[test]
+                fn native_endian() {
+                    let max = ($max - 1) >> (8 * (8 - $bytes));
+                    fn prop(n: $ty_int) -> bool {
+                        let mut buf = [0; 8];
+                        NativeEndian::$write(&mut buf, n, $bytes);
+                        n == NativeEndian::$read(&mut buf[..$bytes], $bytes)
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, max);
+                }
+            }
+        );
+        ($name:ident, $ty_int:ident, $max:expr,
+         $read:ident, $write:ident) => (
+            mod $name {
+                use std::mem::size_of;
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+                use super::qc_sized;
+
+                #[test]
+                fn big_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let bytes = size_of::<$ty_int>();
+                        let mut buf = [0; 8];
+                        BigEndian::$write(&mut buf[8 - bytes..], n);
+                        n == BigEndian::$read(&mut buf[8 - bytes..])
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn little_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let bytes = size_of::<$ty_int>();
+                        let mut buf = [0; 8];
+                        LittleEndian::$write(&mut buf[..bytes], n);
+                        n == LittleEndian::$read(&mut buf[..bytes])
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn native_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let bytes = size_of::<$ty_int>();
+                        let mut buf = [0; 8];
+                        NativeEndian::$write(&mut buf[..bytes], n);
+                        n == NativeEndian::$read(&mut buf[..bytes])
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+            }
+        );
+    }
+
+    qc_byte_order!(prop_u16, u16, ::std::u16::MAX as u64, read_u16, write_u16);
+    qc_byte_order!(prop_i16, i16, ::std::i16::MAX as u64, read_i16, write_i16);
+    qc_byte_order!(prop_u32, u32, ::std::u32::MAX as u64, read_u32, write_u32);
+    qc_byte_order!(prop_i32, i32, ::std::i32::MAX as u64, read_i32, write_i32);
+    qc_byte_order!(prop_u64, u64, ::std::u64::MAX as u64, read_u64, write_u64);
+    qc_byte_order!(prop_i64, i64, ::std::i64::MAX as u64, read_i64, write_i64);
+    qc_byte_order!(prop_f32, f32, ::std::u64::MAX as u64, read_f32, write_f32);
+    qc_byte_order!(prop_f64, f64, ::std::i64::MAX as u64, read_f64, write_f64);
+
+    qc_byte_order!(prop_uint_1, u64, super::U64_MAX, 1, read_uint, write_uint);
+    qc_byte_order!(prop_uint_2, u64, super::U64_MAX, 2, read_uint, write_uint);
+    qc_byte_order!(prop_uint_3, u64, super::U64_MAX, 3, read_uint, write_uint);
+    qc_byte_order!(prop_uint_4, u64, super::U64_MAX, 4, read_uint, write_uint);
+    qc_byte_order!(prop_uint_5, u64, super::U64_MAX, 5, read_uint, write_uint);
+    qc_byte_order!(prop_uint_6, u64, super::U64_MAX, 6, read_uint, write_uint);
+    qc_byte_order!(prop_uint_7, u64, super::U64_MAX, 7, read_uint, write_uint);
+    qc_byte_order!(prop_uint_8, u64, super::U64_MAX, 8, read_uint, write_uint);
+
+    qc_byte_order!(prop_int_1, i64, super::I64_MAX, 1, read_int, write_int);
+    qc_byte_order!(prop_int_2, i64, super::I64_MAX, 2, read_int, write_int);
+    qc_byte_order!(prop_int_3, i64, super::I64_MAX, 3, read_int, write_int);
+    qc_byte_order!(prop_int_4, i64, super::I64_MAX, 4, read_int, write_int);
+    qc_byte_order!(prop_int_5, i64, super::I64_MAX, 5, read_int, write_int);
+    qc_byte_order!(prop_int_6, i64, super::I64_MAX, 6, read_int, write_int);
+    qc_byte_order!(prop_int_7, i64, super::I64_MAX, 7, read_int, write_int);
+    qc_byte_order!(prop_int_8, i64, super::I64_MAX, 8, read_int, write_int);
+
+    macro_rules! qc_bytes_ext {
+        ($name:ident, $ty_int:ident, $max:expr,
+         $bytes:expr, $read:ident, $write:ident) => (
+            mod $name {
+                use std::io::Cursor;
+                use {
+                    ReadBytesExt, WriteBytesExt,
+                    BigEndian, NativeEndian, LittleEndian,
+                };
+                use super::qc_sized;
+
+                #[test]
+                fn big_endian() {
+                    let max = ($max - 1) >> (8 * (8 - $bytes));
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<BigEndian>(n).unwrap();
+                        let mut rdr = Vec::new();
+                        rdr.extend(wtr[8 - $bytes..].iter().map(|&x|x));
+                        let mut rdr = Cursor::new(rdr);
+                        n == rdr.$read::<BigEndian>($bytes).unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, max);
+                }
+
+                #[test]
+                fn little_endian() {
+                    let max = ($max - 1) >> (8 * (8 - $bytes));
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<LittleEndian>(n).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<LittleEndian>($bytes).unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, max);
+                }
+
+                #[test]
+                fn native_endian() {
+                    let max = ($max - 1) >> (8 * (8 - $bytes));
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<NativeEndian>(n).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<NativeEndian>($bytes).unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, max);
+                }
+            }
+        );
+        ($name:ident, $ty_int:ident, $max:expr, $read:ident, $write:ident) => (
+            mod $name {
+                use std::io::Cursor;
+                use {
+                    ReadBytesExt, WriteBytesExt,
+                    BigEndian, NativeEndian, LittleEndian,
+                };
+                use super::qc_sized;
+
+                #[test]
+                fn big_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<BigEndian>(n).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<BigEndian>().unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn little_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<LittleEndian>(n).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<LittleEndian>().unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn native_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<NativeEndian>(n).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<NativeEndian>().unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+            }
+        );
+    }
+
+    qc_bytes_ext!(prop_ext_u16, u16, ::std::u16::MAX as u64, read_u16, write_u16);
+    qc_bytes_ext!(prop_ext_i16, i16, ::std::i16::MAX as u64, read_i16, write_i16);
+    qc_bytes_ext!(prop_ext_u32, u32, ::std::u32::MAX as u64, read_u32, write_u32);
+    qc_bytes_ext!(prop_ext_i32, i32, ::std::i32::MAX as u64, read_i32, write_i32);
+    qc_bytes_ext!(prop_ext_u64, u64, ::std::u64::MAX as u64, read_u64, write_u64);
+    qc_bytes_ext!(prop_ext_i64, i64, ::std::i64::MAX as u64, read_i64, write_i64);
+    qc_bytes_ext!(prop_ext_f32, f32, ::std::u64::MAX as u64, read_f32, write_f32);
+    qc_bytes_ext!(prop_ext_f64, f64, ::std::i64::MAX as u64, read_f64, write_f64);
+
+    qc_bytes_ext!(prop_ext_uint_1, u64, super::U64_MAX, 1, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_2, u64, super::U64_MAX, 2, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_3, u64, super::U64_MAX, 3, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_4, u64, super::U64_MAX, 4, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_5, u64, super::U64_MAX, 5, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_6, u64, super::U64_MAX, 6, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_7, u64, super::U64_MAX, 7, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_8, u64, super::U64_MAX, 8, read_uint, write_u64);
+
+    qc_bytes_ext!(prop_ext_int_1, i64, super::I64_MAX, 1, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_2, i64, super::I64_MAX, 2, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_3, i64, super::I64_MAX, 3, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_4, i64, super::I64_MAX, 4, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_5, i64, super::I64_MAX, 5, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_6, i64, super::I64_MAX, 6, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_7, i64, super::I64_MAX, 7, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_8, i64, super::I64_MAX, 8, read_int, write_i64);
+
+    // Test that all of the byte conversion functions panic when given a
+    // buffer that is too small.
+    //
+    // These tests are critical to ensure safety, otherwise we might end up
+    // with a buffer overflow.
+    macro_rules! too_small {
+        ($name:ident, $maximally_small:expr, $zero:expr,
+         $read:ident, $write:ident) => (
+            mod $name {
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+
+                #[test]
+                #[should_panic]
+                fn read_big_endian() {
+                    let buf = [0; $maximally_small];
+                    BigEndian::$read(&buf);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_little_endian() {
+                    let buf = [0; $maximally_small];
+                    LittleEndian::$read(&buf);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_native_endian() {
+                    let buf = [0; $maximally_small];
+                    NativeEndian::$read(&buf);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_big_endian() {
+                    let mut buf = [0; $maximally_small];
+                    BigEndian::$write(&mut buf, $zero);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_little_endian() {
+                    let mut buf = [0; $maximally_small];
+                    LittleEndian::$write(&mut buf, $zero);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_native_endian() {
+                    let mut buf = [0; $maximally_small];
+                    NativeEndian::$write(&mut buf, $zero);
+                }
+            }
+        );
+        ($name:ident, $maximally_small:expr, $read:ident) => (
+            mod $name {
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+
+                #[test]
+                #[should_panic]
+                fn read_big_endian() {
+                    let buf = [0; $maximally_small];
+                    BigEndian::$read(&buf, $maximally_small + 1);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_little_endian() {
+                    let buf = [0; $maximally_small];
+                    LittleEndian::$read(&buf, $maximally_small + 1);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_native_endian() {
+                    let buf = [0; $maximally_small];
+                    NativeEndian::$read(&buf, $maximally_small + 1);
+                }
+            }
+        );
+    }
+
+    too_small!(small_u16, 1, 0, read_u16, write_u16);
+    too_small!(small_i16, 1, 0, read_i16, write_i16);
+    too_small!(small_u32, 3, 0, read_u32, write_u32);
+    too_small!(small_i32, 3, 0, read_i32, write_i32);
+    too_small!(small_u64, 7, 0, read_u64, write_u64);
+    too_small!(small_i64, 7, 0, read_i64, write_i64);
+    too_small!(small_f32, 3, 0.0, read_f32, write_f32);
+    too_small!(small_f64, 7, 0.0, read_f64, write_f64);
+
+    too_small!(small_uint_1, 1, read_uint);
+    too_small!(small_uint_2, 2, read_uint);
+    too_small!(small_uint_3, 3, read_uint);
+    too_small!(small_uint_4, 4, read_uint);
+    too_small!(small_uint_5, 5, read_uint);
+    too_small!(small_uint_6, 6, read_uint);
+    too_small!(small_uint_7, 7, read_uint);
+
+    too_small!(small_int_1, 1, read_int);
+    too_small!(small_int_2, 2, read_int);
+    too_small!(small_int_3, 3, read_int);
+    too_small!(small_int_4, 4, read_int);
+    too_small!(small_int_5, 5, read_int);
+    too_small!(small_int_6, 6, read_int);
+    too_small!(small_int_7, 7, read_int);
+
+    #[test]
+    fn uint_bigger_buffer() {
+        use {ByteOrder, LittleEndian};
+        let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5);
+        assert_eq!(n, 0x0504030201);
+    }
+}
diff --git a/vendor/byteorder-0.5.3/src/new.rs b/vendor/byteorder-0.5.3/src/new.rs
new file mode 100644
index 0000000..b5f3770
--- /dev/null
+++ b/vendor/byteorder-0.5.3/src/new.rs
@@ -0,0 +1,269 @@
+use std::io::{self, Result};
+
+use ByteOrder;
+
+/// Extends `Read` with methods for reading numbers. (For `std::io`.)
+///
+/// Most of the methods defined here have an unconstrained type parameter that
+/// must be explicitly instantiated. Typically, it is instantiated with either
+/// the `BigEndian` or `LittleEndian` types defined in this crate.
+///
+/// # Examples
+///
+/// Read unsigned 16 bit big-endian integers from a `Read`:
+///
+/// ```rust
+/// use std::io::Cursor;
+/// use byteorder::{BigEndian, ReadBytesExt};
+///
+/// let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+/// assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+/// assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+/// ```
+pub trait ReadBytesExt: io::Read {
+    /// Reads an unsigned 8 bit integer from the underlying reader.
+    ///
+    /// Note that since this reads a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    #[inline]
+    fn read_u8(&mut self) -> Result<u8> {
+        let mut buf = [0; 1];
+        try!(self.read_exact(&mut buf));
+        Ok(buf[0])
+    }
+
+    /// Reads a signed 8 bit integer from the underlying reader.
+    ///
+    /// Note that since this reads a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    #[inline]
+    fn read_i8(&mut self) -> Result<i8> {
+        let mut buf = [0; 1];
+        try!(self.read_exact(&mut buf));
+        Ok(buf[0] as i8)
+    }
+
+    /// Reads an unsigned 16 bit integer from the underlying reader.
+    #[inline]
+    fn read_u16<T: ByteOrder>(&mut self) -> Result<u16> {
+        let mut buf = [0; 2];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u16(&buf))
+    }
+
+    /// Reads a signed 16 bit integer from the underlying reader.
+    #[inline]
+    fn read_i16<T: ByteOrder>(&mut self) -> Result<i16> {
+        let mut buf = [0; 2];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i16(&buf))
+    }
+
+    /// Reads an unsigned 32 bit integer from the underlying reader.
+    #[inline]
+    fn read_u32<T: ByteOrder>(&mut self) -> Result<u32> {
+        let mut buf = [0; 4];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u32(&buf))
+    }
+
+    /// Reads a signed 32 bit integer from the underlying reader.
+    #[inline]
+    fn read_i32<T: ByteOrder>(&mut self) -> Result<i32> {
+        let mut buf = [0; 4];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i32(&buf))
+    }
+
+    /// Reads an unsigned 64 bit integer from the underlying reader.
+    #[inline]
+    fn read_u64<T: ByteOrder>(&mut self) -> Result<u64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u64(&buf))
+    }
+
+    /// Reads a signed 64 bit integer from the underlying reader.
+    #[inline]
+    fn read_i64<T: ByteOrder>(&mut self) -> Result<i64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i64(&buf))
+    }
+
+    /// Reads an unsigned n-bytes integer from the underlying reader.
+    #[inline]
+    fn read_uint<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf[..nbytes]));
+        Ok(T::read_uint(&buf[..nbytes], nbytes))
+    }
+
+    /// Reads a signed n-bytes integer from the underlying reader.
+    #[inline]
+    fn read_int<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf[..nbytes]));
+        Ok(T::read_int(&buf[..nbytes], nbytes))
+    }
+
+    /// Reads a IEEE754 single-precision (4 bytes) floating point number from
+    /// the underlying reader.
+    #[inline]
+    fn read_f32<T: ByteOrder>(&mut self) -> Result<f32> {
+        let mut buf = [0; 4];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_f32(&buf))
+    }
+
+    /// Reads a IEEE754 double-precision (8 bytes) floating point number from
+    /// the underlying reader.
+    #[inline]
+    fn read_f64<T: ByteOrder>(&mut self) -> Result<f64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_f64(&buf))
+    }
+}
+
+/// All types that implement `Read` get methods defined in `ReadBytesExt`
+/// for free.
+impl<R: io::Read + ?Sized> ReadBytesExt for R {}
+
+/// Extends `Write` with methods for writing numbers. (For `std::io`.)
+///
+/// Most of the methods defined here have an unconstrained type parameter that
+/// must be explicitly instantiated. Typically, it is instantiated with either
+/// the `BigEndian` or `LittleEndian` types defined in this crate.
+///
+/// # Examples
+///
+/// Write unsigned 16 bit big-endian integers to a `Write`:
+///
+/// ```rust
+/// use byteorder::{BigEndian, WriteBytesExt};
+///
+/// let mut wtr = vec![];
+/// wtr.write_u16::<BigEndian>(517).unwrap();
+/// wtr.write_u16::<BigEndian>(768).unwrap();
+/// assert_eq!(wtr, vec![2, 5, 3, 0]);
+/// ```
+pub trait WriteBytesExt: io::Write {
+    /// Writes an unsigned 8 bit integer to the underlying writer.
+    ///
+    /// Note that since this writes a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    #[inline]
+    fn write_u8(&mut self, n: u8) -> Result<()> {
+        self.write_all(&[n])
+    }
+
+    /// Writes a signed 8 bit integer to the underlying writer.
+    ///
+    /// Note that since this writes a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    #[inline]
+    fn write_i8(&mut self, n: i8) -> Result<()> {
+        self.write_all(&[n as u8])
+    }
+
+    /// Writes an unsigned 16 bit integer to the underlying writer.
+    #[inline]
+    fn write_u16<T: ByteOrder>(&mut self, n: u16) -> Result<()> {
+        let mut buf = [0; 2];
+        T::write_u16(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 16 bit integer to the underlying writer.
+    #[inline]
+    fn write_i16<T: ByteOrder>(&mut self, n: i16) -> Result<()> {
+        let mut buf = [0; 2];
+        T::write_i16(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned 32 bit integer to the underlying writer.
+    #[inline]
+    fn write_u32<T: ByteOrder>(&mut self, n: u32) -> Result<()> {
+        let mut buf = [0; 4];
+        T::write_u32(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 32 bit integer to the underlying writer.
+    #[inline]
+    fn write_i32<T: ByteOrder>(&mut self, n: i32) -> Result<()> {
+        let mut buf = [0; 4];
+        T::write_i32(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned 64 bit integer to the underlying writer.
+    #[inline]
+    fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_u64(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 64 bit integer to the underlying writer.
+    #[inline]
+    fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_i64(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned n-bytes integer to the underlying writer.
+    ///
+    /// If the given integer is not representable in the given number of bytes,
+    /// this method panics. If `nbytes > 8`, this method panics.
+    #[inline]
+    fn write_uint<T: ByteOrder>(
+        &mut self,
+        n: u64,
+        nbytes: usize,
+    ) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_uint(&mut buf, n, nbytes);
+        self.write_all(&buf[0..nbytes])
+    }
+
+    /// Writes a signed n-bytes integer to the underlying writer.
+    ///
+    /// If the given integer is not representable in the given number of bytes,
+    /// this method panics. If `nbytes > 8`, this method panics.
+    #[inline]
+    fn write_int<T: ByteOrder>(
+        &mut self,
+        n: i64,
+        nbytes: usize,
+    ) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_int(&mut buf, n, nbytes);
+        self.write_all(&buf[0..nbytes])
+    }
+
+    /// Writes a IEEE754 single-precision (4 bytes) floating point number to
+    /// the underlying writer.
+    #[inline]
+    fn write_f32<T: ByteOrder>(&mut self, n: f32) -> Result<()> {
+        let mut buf = [0; 4];
+        T::write_f32(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a IEEE754 double-precision (8 bytes) floating point number to
+    /// the underlying writer.
+    #[inline]
+    fn write_f64<T: ByteOrder>(&mut self, n: f64) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_f64(&mut buf, n);
+        self.write_all(&buf)
+    }
+}
+
+/// All types that implement `Write` get methods defined in `WriteBytesExt`
+/// for free.
+impl<W: io::Write + ?Sized> WriteBytesExt for W {}
diff --git a/vendor/conv-0.3.3/.cargo-checksum.json b/vendor/conv-0.3.3/.cargo-checksum.json
new file mode 100644
index 0000000..3378182
--- /dev/null
+++ b/vendor/conv-0.3.3/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"f9b1ca6ae27d1c18215265024629a8960c31379f206d9ed20f64e0b2dcf79805",".travis.yml":"ed17d8ac9d834ecaaba9736aba1f48340e129f5dcc8bb42423f81b92466b1957","Cargo.toml":"5a5ebfcd3c64dd9c621b2322b9a4f26078afcc6e0898737f6b1c316f22f24d91","LICENSE":"b2507383f9c3de7b2067c5af0fbe8ab5f24bb5fc0f606525201f2890d51c3400","README.md":"961818d81b7596a3575148a8ab54b66b40e7fa5e7942e6f78770635a675de031","src/errors.rs":"60cb67d97d4dcd8cb37c47a107ca064f101e24cb5dc9ff3e56939b87e6ea6372","src/impls.rs":"6620dca1ac72b1b2c1ff46b1ec1a637cbe3ecbde2a2e4471f9e25ca4da706d59","src/lib.rs":"b2573e4eb1e75abac4a959a1f870752fc6d9592e682c34b68d52b31fbf95ccc3","src/macros.rs":"8f5d4cf40c127e1eda1b4c13c1e81a45aed11af8bb6db88e3672a267b79b4daa","src/misc.rs":"9e4f8012588b81a0e9445d4072dc55a530591b67d3149dc5cc7688409d5e8f69","tests/conv_utils.rs":"e6704c5cda52cb7adafddbc6be4f4a6267cd4caf7eb44864cf8d9809dba3d079","tests/derive_try_from.rs":"f0a5a5f084e01666049f766373327520ff33f18ab845d22e01d111cdaacc36a4","tests/lang_char.rs":"8d410c9c9efcc1d1ba2ff3c1454a5c3b3d3913596ba59ffd34eb973ad87e56eb","tests/lang_floats.rs":"398ce7cae3388f707d0850ddde6ae46ed26d3cabfe8eb1417cc5093fe49e6bcb","tests/lang_ints.rs":"fd8179a8d1279f5e42a28622e38a6edbd5206aa6abaea6f7bd40886e6fabb058","tests/unwraps.rs":"0edd2cfd1fcf3ed1804bf1bee68c56ae7edaa2efc6a6599f8d669cd8726ea3e3","tests/use_in_generics.rs":"965d9debc0982fe96103a1a08144c5a9d4b8af07510ea84fc997ead568b49563","tests/util/mod.rs":"fdd9bb3500bd060f70288f79f7dd083eb25a09d8fe6a02f12951208a7ae999cf"},"package":"78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299"}
\ No newline at end of file
diff --git a/vendor/conv-0.3.3/.cargo-ok b/vendor/conv-0.3.3/.cargo-ok
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vendor/conv-0.3.3/.cargo-ok
diff --git a/vendor/conv-0.3.3/.gitignore b/vendor/conv-0.3.3/.gitignore
new file mode 100644
index 0000000..a9d37c5
--- /dev/null
+++ b/vendor/conv-0.3.3/.gitignore
@@ -0,0 +1,2 @@
+target
+Cargo.lock
diff --git a/vendor/conv-0.3.3/.travis.yml b/vendor/conv-0.3.3/.travis.yml
new file mode 100644
index 0000000..067ec09
--- /dev/null
+++ b/vendor/conv-0.3.3/.travis.yml
@@ -0,0 +1,17 @@
+language: rust

+script: cargo build --verbose && cargo test --verbose

+rust:

+  - 1.2.0

+  - 1.3.0

+  - 1.4.0

+  - 1.5.0

+  - 1.6.0

+  - stable

+  - beta

+  - nightly

+matrix:

+  allow_failures:

+    - rust: nightly

+branches:

+  except:

+    - /^issue-.*$/

diff --git a/vendor/conv-0.3.3/Cargo.toml b/vendor/conv-0.3.3/Cargo.toml
new file mode 100644
index 0000000..42f42aa
--- /dev/null
+++ b/vendor/conv-0.3.3/Cargo.toml
@@ -0,0 +1,22 @@
+[package]

+name = "conv"

+version = "0.3.3"

+authors = ["Daniel Keep <daniel.keep@gmail.com>"]

+

+description = "This crate provides a number of conversion traits with more specific semantics than those provided by 'as' or 'From'/'Into'."

+repository = "https://github.com/DanielKeep/rust-conv"

+documentation = "https://danielkeep.github.io/rust-conv/doc/conv/index.html"

+readme = "README.md"

+license = "MIT"

+keywords = ["from", "into", "conversion", "approximation"]

+

+exclude = [

+    "scripts/*",

+    "update-docs.py",

+]

+

+[dependencies]

+custom_derive = "0.1.2"

+

+[dev-dependencies]

+quickcheck = "0.2.21, < 0.2.25"

diff --git a/vendor/conv-0.3.3/LICENSE b/vendor/conv-0.3.3/LICENSE
new file mode 100644
index 0000000..a2af29b
--- /dev/null
+++ b/vendor/conv-0.3.3/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2015 Daniel Keep

+

+Permission is hereby granted, free of charge, to any

+person obtaining a copy of this software and associated

+documentation files (the "Software"), to deal in the

+Software without restriction, including without

+limitation the rights to use, copy, modify, merge,

+publish, distribute, sublicense, and/or sell copies of

+the Software, and to permit persons to whom the Software

+is furnished to do so, subject to the following

+conditions:

+

+The above copyright notice and this permission notice

+shall be included in all copies or substantial portions

+of the Software.

+

+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF

+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED

+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A

+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT

+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY

+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION

+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR

+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

+DEALINGS IN THE SOFTWARE.

diff --git a/vendor/conv-0.3.3/README.md b/vendor/conv-0.3.3/README.md
new file mode 100644
index 0000000..85a1a28
--- /dev/null
+++ b/vendor/conv-0.3.3/README.md
@@ -0,0 +1,129 @@
+

+# `conv`

+

+This crate provides a number of conversion traits with more specific semantics than those provided by `as` or `From`/`Into`.

+

+The goal with the traits provided here is to be more specific about what generic code can rely on, as well as provide reasonably self-describing alternatives to the standard `From`/`Into` traits.  For example, the although `T: From<U>` might be satisfied in generic code, this says nothing about what *kind* of conversion that represents.

+

+In addition, `From`/`Into` provide no facility for a conversion failing, meaning that implementations may need to choose between conversions that may not be valid, or panicking; neither option is appealing in general.

+

+**Links**

+

+* [Latest Release](https://crates.io/crates/scan-rules/)

+* [Latest Docs](https://danielkeep.github.io/rust-scan-rules/doc/scan_rules/index.html)

+* [Repository](https://github.com/DanielKeep/rust-scan-rules)

+

+## Compatibility

+

+`conv` is compatible with Rust 1.2 and higher.

+

+## Examples

+

+```rust

+# extern crate conv;

+# use conv::*;

+# fn main() {

+// This *cannot* fail, so we can use `unwrap_ok` to discard the `Result`.

+assert_eq!(u8::value_from(0u8).unwrap_ok(), 0u8);

+

+// This *can* fail.  Specifically, it can overflow toward negative infinity.

+assert_eq!(u8::value_from(0i8),     Ok(0u8));

+assert_eq!(u8::value_from(-1i8),    Err(NegOverflow(-1)));

+

+// This can overflow in *either* direction; hence the change to `RangeError`.

+assert_eq!(u8::value_from(-1i16),   Err(RangeError::NegOverflow(-1)));

+assert_eq!(u8::value_from(0i16),    Ok(0u8));

+assert_eq!(u8::value_from(256i16),  Err(RangeError::PosOverflow(256)));

+

+// We can use the extension traits to simplify this a little.

+assert_eq!(u8::value_from(-1i16).unwrap_or_saturate(),  0u8);

+assert_eq!(u8::value_from(0i16).unwrap_or_saturate(),   0u8);

+assert_eq!(u8::value_from(256i16).unwrap_or_saturate(), 255u8);

+

+// Obviously, all integers can be "approximated" using the default scheme (it

+// doesn't *do* anything), but they can *also* be approximated with the

+// `Wrapping` scheme.

+assert_eq!(

+    <u8 as ApproxFrom<_, DefaultApprox>>::approx_from(400u16),

+    Err(PosOverflow(400)));

+assert_eq!(

+    <u8 as ApproxFrom<_, Wrapping>>::approx_from(400u16),

+    Ok(144u8));

+

+// This is rather inconvenient; as such, there are a number of convenience

+// extension methods available via `ConvUtil` and `ConvAsUtil`.

+assert_eq!(400u16.approx(),                       Err::<u8, _>(PosOverflow(400)));

+assert_eq!(400u16.approx_by::<Wrapping>(),        Ok::<u8, _>(144u8));

+assert_eq!(400u16.approx_as::<u8>(),              Err(PosOverflow(400)));

+assert_eq!(400u16.approx_as_by::<u8, Wrapping>(), Ok(144));

+

+// Integer -> float conversions *can* fail due to limited precision.

+// Once the continuous range of exactly representable integers is exceeded, the

+// provided implementations fail with overflow errors.

+assert_eq!(f32::value_from(16_777_216i32), Ok(16_777_216.0f32));

+assert_eq!(f32::value_from(16_777_217i32), Err(RangeError::PosOverflow(16_777_217)));

+

+// Float -> integer conversions have to be done using approximations.  Although

+// exact conversions are *possible*, "advertising" this with an implementation

+// is misleading.

+//

+// Note that `DefaultApprox` for float -> integer uses whatever rounding

+// mode is currently active (*i.e.* whatever `as` would do).

+assert_eq!(41.0f32.approx(), Ok(41u8));

+assert_eq!(41.3f32.approx(), Ok(41u8));

+assert_eq!(41.5f32.approx(), Ok(41u8));

+assert_eq!(41.8f32.approx(), Ok(41u8));

+assert_eq!(42.0f32.approx(), Ok(42u8));

+

+assert_eq!(255.0f32.approx(), Ok(255u8));

+assert_eq!(256.0f32.approx(), Err::<u8, _>(FloatError::PosOverflow(256.0)));

+

+// Sometimes, it can be useful to saturate the conversion from float to

+// integer directly, then account for NaN as input separately.  The `Saturate`

+// extension trait exists for this reason.

+assert_eq!((-23.0f32).approx_as::<u8>().saturate(), Ok(0));

+assert_eq!(302.0f32.approx_as::<u8>().saturate(), Ok(255u8));

+assert!(std::f32::NAN.approx_as::<u8>().saturate().is_err());

+

+// If you really don't care about the specific kind of error, you can just rely

+// on automatic conversion to `GeneralErrorKind`.

+fn too_many_errors() -> Result<(), GeneralErrorKind> {

+    assert_eq!({let r: u8 = try!(0u8.value_into()); r},  0u8);

+    assert_eq!({let r: u8 = try!(0i8.value_into()); r},  0u8);

+    assert_eq!({let r: u8 = try!(0i16.value_into()); r}, 0u8);

+    assert_eq!({let r: u8 = try!(0.0f32.approx()); r},   0u8);

+    Ok(())

+}

+# let _ = too_many_errors();

+# }

+```

+

+## Change Log

+

+### v0.3.2

+

+- Added integer ↔ `char` conversions.

+- Added missing `isize`/`usize` → `f32`/`f64` conversions.

+- Fixed the error type of `i64` → `usize` for 64-bit targets.

+

+### v0.3.1

+

+- Change to `unwrap_ok` for better codegen (thanks bluss).

+- Fix for Rust breaking change (code in question was dodgy anyway; thanks m4rw3r).

+

+### v0.3.0

+

+- Added an `Error` constraint to all `Err` associated types.  This will break any user-defined conversions where the `Err` type does not implement `Error`.

+- Renamed the `Overflow` and `Underflow` errors to `PosOverflow` and `NegOverflow` respectively.  In the context of floating point conversions, "underflow" usually means the value was too close to zero to correctly represent.

+

+### v0.2.1

+

+- Added `ConvUtil::into_as<Dst>` as a shortcut for `Into::<Dst>::into`.

+- Added `#[inline]` attributes.

+- Added `Saturate::saturate`, which can saturate `Result`s arising from over/underflow.

+

+### v0.2.0

+

+- Changed all error types to include the original input as payload.  This breaks pretty much *everything*.  Sorry about that.  On the bright side, there's now no downside to using the conversion traits for non-`Copy` types.

+- Added the normal rounding modes for float → int approximations: `RoundToNearest`, `RoundToNegInf`, `RoundToPosInf`, and `RoundToZero`.

+- `ApproxWith` is now subsumed by a pair of extension traits (`ConvUtil` and `ConvAsUtil`), that also have shortcuts for `TryInto` and `ValueInto` so that you can specify the destination type on the method.

diff --git a/vendor/conv-0.3.3/src/errors.rs b/vendor/conv-0.3.3/src/errors.rs
new file mode 100644
index 0000000..9e005b0
--- /dev/null
+++ b/vendor/conv-0.3.3/src/errors.rs
@@ -0,0 +1,606 @@
+/*!

+This module defines the various error types that can be produced by a failed conversion.

+

+In addition, it also defines some extension traits to make working with failable conversions more ergonomic (see the `Unwrap*` traits).

+*/

+

+use std::any::Any;

+use std::error::Error;

+use std::fmt::{self, Debug, Display};

+use misc::{Saturated, InvalidSentinel, SignedInfinity};

+

+macro_rules! Desc {

+    (

+        ($desc:expr)

+        pub struct $name:ident<$t:ident> $_body:tt;

+    ) => {

+        impl<$t> Display for $name<$t> {

+            fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {

+                write!(fmt, $desc)

+            }

+        }

+

+        impl<$t> Error for $name<$t> where $t: Any {

+            fn description(&self) -> &str {

+                $desc

+            }

+        }

+    };

+}

+

+macro_rules! DummyDebug {

+    (

+        () pub enum $name:ident<$t:ident> {

+            $(#[doc=$_doc:tt] $vname:ident($_vpay:ident),)+

+        }

+    ) => {

+        impl<$t> Debug for $name<$t> {

+            fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {

+                let msg = match *self {

+                    $($name::$vname(_) => stringify!($vname),)+

+                };

+                write!(fmt, concat!(stringify!($name), "::{}(..)"), msg)

+            }

+        }

+    };

+

+    (

+        () pub struct $name:ident<$t:ident>(pub $_pay:ident);

+    ) => {

+        impl<$t> Debug for $name<$t> {

+            fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {

+                write!(fmt, concat!(stringify!($name), "(..)"))

+            }

+        }

+    };

+}

+

+macro_rules! EnumDesc {

+    (

+        ($($vname:ident => $vdesc:expr,)+) 

+        pub enum $name:ident $_body:tt

+    ) => {

+        impl Display for $name {

+            fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {

+                write!(fmt, "{}",

+                    match *self { $($name::$vname => $vdesc,)+ })

+            }

+        }

+

+        impl Error for $name {

+            fn description(&self) -> &str {

+                match *self { $($name::$vname => $vdesc,)+ }

+            }

+        }

+    };

+

+    (

+        ($($vname:ident => $vdesc:expr,)+) 

+        pub enum $name:ident<$t:ident> $_body:tt

+    ) => {

+        impl<$t> Display for $name<$t> {

+            fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {

+                write!(fmt, "{}",

+                    match *self { $($name::$vname(..) => $vdesc,)+ })

+            }

+        }

+

+        impl<$t> Error for $name<$t> where $t: Any {

+            fn description(&self) -> &str {

+                match *self { $($name::$vname(..) => $vdesc,)+ }

+            }

+        }

+    };

+}

+

+macro_rules! FromName {

+    (

+        ($fname:ident)

+        pub enum $name:ident<$t:ident> $_body:tt

+    ) => {

+        impl<$t> From<$fname<$t>> for $name<$t> {

+            #[inline]

+            fn from(e: $fname<$t>) -> Self {

+                $name::$fname(e.into_inner())

+            }

+        }

+    };

+

+    (

+        ($fname:ident<$t:ident>)

+        pub enum $name:ident $_body:tt

+    ) => {

+        impl<$t> From<$fname<$t>> for $name {

+            #[inline]

+            fn from(_: $fname<$t>) -> Self {

+                $name::$fname

+            }

+        }

+    };

+}

+

+macro_rules! FromNoError {

+    (

+        () pub enum $name:ident $_body:tt

+    ) => {

+        impl From<NoError> for $name {

+            #[inline]

+            fn from(_: NoError) -> Self {

+                panic!(concat!("cannot convert NoError into ", stringify!($name)))

+            }

+        }

+    };

+

+    (

+        () pub enum $name:ident<$t:ident> $_body:tt

+    ) => {

+        impl<$t> From<NoError> for $name<$t> {

+            fn from(_: NoError) -> Self {

+                panic!(concat!("cannot convert NoError into ", stringify!($name)))

+            }

+        }

+    };

+

+    (

+        () pub struct $name:ident<$t:ident> $_body:tt;

+    ) => {

+        impl<$t> From<NoError> for $name<$t> {

+            fn from(_: NoError) -> Self {

+                panic!(concat!("cannot convert NoError into ", stringify!($name)))

+            }

+        }

+    };

+}

+

+macro_rules! FromRemap {

+    (

+        ($from:ident($($vname:ident),+))

+        pub enum $name:ident $_body:tt

+    ) => {

+        impl From<$from> for $name {

+            #[inline]

+            fn from(e: $from) -> Self {

+                match e {

+                    $($from::$vname => $name::$vname,)+

+                }

+            }

+        }

+    };

+

+    (

+        ($from:ident<$t:ident>($($vname:ident),+))

+        pub enum $name:ident $_body:tt

+    ) => {

+        impl<$t> From<$from<$t>> for $name {

+            #[inline]

+            fn from(e: $from<$t>) -> Self {

+                match e {

+                    $($from::$vname(..) => $name::$vname,)+

+                }

+            }

+        }

+    };

+

+    (

+        ($from:ident($($vname:ident),+))

+        pub enum $name:ident<$t:ident> $_body:tt

+    ) => {

+        impl<$t> From<$from<$t>> for $name<$t> {

+            #[inline]

+            fn from(e: $from<$t>) -> Self {

+                match e {

+                    $($from::$vname(v) => $name::$vname(v),)+

+                }

+            }

+        }

+    };

+}

+

+macro_rules! IntoInner {

+    (

+        () pub enum $name:ident<$t:ident> {

+            $(#[doc=$_doc:tt] $vname:ident($_vpay:ident),)+

+        }

+    ) => {

+        impl<$t> $name<$t> {

+            /// Returns the value stored in this error.

+            #[inline]

+            pub fn into_inner(self) -> $t {

+                match self { $($name::$vname(v))|+ => v }

+            }

+        }

+    };

+

+    (

+        () pub struct $name:ident<$t:ident>(pub $_pay:ident);

+    ) => {

+        impl<$t> $name<$t> {

+            /// Returns the value stored in this error.

+            #[inline]

+            pub fn into_inner(self) -> $t {

+                self.0

+            }

+        }

+    };

+}

+

+custom_derive!{

+    /**

+    A general error enumeration that subsumes all other conversion errors.

+

+    This exists primarily as a "catch-all" for reliably unifying various different kinds of conversion errors.

+    */

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd,

+        IntoInner, DummyDebug, FromNoError,

+        EnumDesc(

+            NegOverflow => "conversion resulted in negative overflow",

+            PosOverflow => "conversion resulted in positive overflow",

+            Unrepresentable => "could not convert unrepresentable value",

+        ),

+        FromName(Unrepresentable),

+        FromName(NegOverflow),

+        FromName(PosOverflow),

+        FromRemap(RangeError(NegOverflow, PosOverflow))

+    )]

+    pub enum GeneralError<T> {

+        /// Input was too negative for the target type.

+        NegOverflow(T),

+

+        /// Input was too positive for the target type.

+        PosOverflow(T),

+

+        /// Input was not representable in the target type.

+        Unrepresentable(T),

+    }

+}

+

+impl<T> From<FloatError<T>> for GeneralError<T> {

+    #[inline]

+    fn from(e: FloatError<T>) -> GeneralError<T> {

+        use self::FloatError as F;

+        use self::GeneralError as G;

+        match e {

+            F::NegOverflow(v) => G::NegOverflow(v),

+            F::PosOverflow(v) => G::PosOverflow(v),

+            F::NotANumber(v) => G::Unrepresentable(v),

+        }

+    }

+}

+

+custom_derive! {

+    /**

+    A general error enumeration that subsumes all other conversion errors, but discards all input payloads the errors may be carrying.

+

+    This exists primarily as a "catch-all" for reliably unifying various different kinds of conversion errors, and between different input types.

+    */

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug,

+        FromNoError,

+        EnumDesc(

+            NegOverflow => "conversion resulted in negative overflow",

+            PosOverflow => "conversion resulted in positive overflow",

+            Unrepresentable => "could not convert unrepresentable value",

+        ),

+        FromName(Unrepresentable<T>),

+        FromName(NegOverflow<T>),

+        FromName(PosOverflow<T>),

+        FromRemap(RangeErrorKind(NegOverflow, PosOverflow)),

+        FromRemap(RangeError<T>(NegOverflow, PosOverflow)),

+        FromRemap(GeneralError<T>(NegOverflow, PosOverflow, Unrepresentable))

+    )]

+    pub enum GeneralErrorKind {

+        /// Input was too negative for the target type.

+        NegOverflow,

+

+        /// Input was too positive for the target type.

+        PosOverflow,

+

+        /// Input was not representable in the target type.

+        Unrepresentable,

+    }

+}

+

+impl<T> From<FloatError<T>> for GeneralErrorKind {

+    #[inline]

+    fn from(e: FloatError<T>) -> GeneralErrorKind {

+        use self::FloatError as F;

+        use self::GeneralErrorKind as G;

+        match e {

+            F::NegOverflow(..) => G::NegOverflow,

+            F::PosOverflow(..) => G::PosOverflow,

+            F::NotANumber(..) => G::Unrepresentable,

+        }

+    }

+}

+

+/**

+Indicates that it is not possible for the conversion to fail.

+

+You can use the [`UnwrapOk::unwrap_ok`](./trait.UnwrapOk.html#tymethod.unwrap_ok) method to discard the (statically impossible) `Err` case from a `Result<_, NoError>`, without using `Result::unwrap` (which is typically viewed as a "code smell").

+*/

+#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]

+pub enum NoError {}

+

+impl Display for NoError {

+    fn fmt(&self, _: &mut fmt::Formatter) -> Result<(), fmt::Error> {

+        unreachable!()

+    }

+}

+

+impl Error for NoError {

+    fn description(&self) -> &str {

+        unreachable!()

+    }

+}

+

+custom_derive! {

+    /// Indicates that the conversion failed because the value was not representable.

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd,

+        IntoInner, DummyDebug, FromNoError,

+        Desc("could not convert unrepresentable value")

+    )]

+    pub struct Unrepresentable<T>(pub T);

+}

+

+custom_derive! {

+    /// Indicates that the conversion failed due to a negative overflow.

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd,

+        IntoInner, DummyDebug, FromNoError,

+        Desc("conversion resulted in negative overflow")

+    )]

+    pub struct NegOverflow<T>(pub T);

+}

+

+custom_derive! {

+    /// Indicates that the conversion failed due to a positive overflow.

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd,

+        IntoInner, DummyDebug, FromNoError,

+        Desc("conversion resulted in positive overflow")

+    )]

+    pub struct PosOverflow<T>(pub T);

+}

+

+custom_derive! {

+    /**

+    Indicates that a conversion from a floating point type failed.

+    */

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd,

+        IntoInner, DummyDebug, FromNoError,

+        EnumDesc(

+            NegOverflow => "conversion resulted in negative overflow",

+            PosOverflow => "conversion resulted in positive overflow",

+            NotANumber => "conversion target does not support not-a-number",

+        ),

+        FromName(NegOverflow),

+        FromName(PosOverflow),

+        FromRemap(RangeError(NegOverflow, PosOverflow))

+    )]

+    pub enum FloatError<T> {

+        /// Input was too negative for the target type.

+        NegOverflow(T),

+

+        /// Input was too positive for the target type.

+        PosOverflow(T),

+

+        /// Input was not-a-number, which the target type could not represent.

+        NotANumber(T),

+    }

+}

+

+custom_derive! {

+    /**

+    Indicates that a conversion failed due to a range error.

+    */

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd,

+        IntoInner, DummyDebug, FromNoError,

+        EnumDesc(

+            NegOverflow => "conversion resulted in negative overflow",

+            PosOverflow => "conversion resulted in positive overflow",

+        ),

+        FromName(NegOverflow),

+        FromName(PosOverflow)

+    )]

+    pub enum RangeError<T> {

+        /// Input was too negative for the target type.

+        NegOverflow(T),

+

+        /// Input was too positive the target type.

+        PosOverflow(T),

+    }

+}

+

+custom_derive! {

+    /**

+    Indicates that a conversion failed due to a range error.

+

+    This is a variant of `RangeError` that does not retain the input value which caused the error.  It exists to help unify some utility methods and should not generally be used directly, unless you are targeting the `Unwrap*` traits.

+    */

+    #[derive(

+        Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug,

+        FromNoError,

+        EnumDesc(

+            NegOverflow => "conversion resulted in negative overflow",

+            PosOverflow => "conversion resulted in positive overflow",

+        ),

+        FromName(NegOverflow<T>),

+        FromName(PosOverflow<T>),

+        FromRemap(RangeError<T>(NegOverflow, PosOverflow))

+    )]

+    pub enum RangeErrorKind {

+        /// Input was too negative for the target type.

+        NegOverflow,

+

+        /// Input was too positive for the target type.

+        PosOverflow,

+    }

+}

+

+/**

+Saturates a `Result`.

+*/

+pub trait Saturate {

+    /// The result of saturating.

+    type Output;

+

+    /**

+    Replaces an overflow error with a saturated value.

+

+    Unlike `unwrap_or_saturate`, this method can be used in cases where the `Result` error type can encode failures *other* than overflow and underflow.  For example, you cannot saturate a float-to-integer conversion using `unwrap_or_saturate` as the error might be `NotANumber`, which doesn't have a meaningful saturation "direction".

+

+    The output of this method will be a `Result` where the error type *does not* contain overflow conditions.  What conditions remain must still be dealt with in some fashion.

+    */

+    fn saturate(self) -> Self::Output;

+}

+

+impl<T, U> Saturate for Result<T, FloatError<U>>

+where T: Saturated {

+    type Output = Result<T, Unrepresentable<U>>;

+

+    #[inline]

+    fn saturate(self) -> Self::Output {

+        use self::FloatError::*;

+        match self {

+            Ok(v) => Ok(v),

+            Err(NegOverflow(_)) => Ok(T::saturated_min()),

+            Err(PosOverflow(_)) => Ok(T::saturated_max()),

+            Err(NotANumber(v)) => Err(Unrepresentable(v))

+        }

+    }

+}

+

+impl<T, U> Saturate for Result<T, RangeError<U>>

+where T: Saturated {

+    type Output = Result<T, NoError>;

+

+    #[inline]

+    fn saturate(self) -> Self::Output {

+        use self::RangeError::*;

+        match self {

+            Ok(v) => Ok(v),

+            Err(NegOverflow(_)) => Ok(T::saturated_min()),

+            Err(PosOverflow(_)) => Ok(T::saturated_max())

+        }

+    }

+}

+

+impl<T> Saturate for Result<T, RangeErrorKind>

+where T: Saturated {

+    type Output = Result<T, NoError>;

+

+    #[inline]

+    fn saturate(self) -> Self::Output {

+        use self::RangeErrorKind::*;

+        match self {

+            Ok(v) => Ok(v),

+            Err(NegOverflow) => Ok(T::saturated_min()),

+            Err(PosOverflow) => Ok(T::saturated_max())

+        }

+    }

+}

+

+/**

+Safely unwrap a `Result` that cannot contain an error.

+*/

+pub trait UnwrapOk<T> {

+    /**

+    Unwraps a `Result` without possibility of failing.

+

+    Technically, this is not necessary; it's provided simply to make user code a little clearer.

+    */

+    fn unwrap_ok(self) -> T;

+}

+

+impl<T> UnwrapOk<T> for Result<T, NoError> {

+    #[inline]

+    fn unwrap_ok(self) -> T {

+        match self {

+            Ok(v) => v,

+            Err(no_error) => match no_error {},

+        }

+    }

+}

+

+/**

+Unwrap a conversion by saturating to infinity.

+*/

+pub trait UnwrapOrInf {

+    /// The result of unwrapping.

+    type Output;

+

+    /**

+    Either unwraps the successfully converted value, or saturates to infinity in the "direction" of overflow.

+    */

+    fn unwrap_or_inf(self) -> Self::Output;

+}

+

+/**

+Unwrap a conversion by replacing a failure with an invalid sentinel value.

+*/

+pub trait UnwrapOrInvalid {

+    /// The result of unwrapping.

+    type Output;

+

+    /**

+    Either unwraps the successfully converted value, or returns the output type's invalid sentinel value.

+    */

+    fn unwrap_or_invalid(self) -> Self::Output;

+}

+

+/**

+Unwrap a conversion by saturating.

+*/

+pub trait UnwrapOrSaturate {

+    /// The result of unwrapping.

+    type Output;

+

+    /**

+    Either unwraps the successfully converted value, or saturates in the "direction" of overflow.

+    */

+    fn unwrap_or_saturate(self) -> Self::Output;

+}

+

+impl<T, E> UnwrapOrInf for Result<T, E>

+where T: SignedInfinity, E: Into<RangeErrorKind> {

+    type Output = T;

+    #[inline]

+    fn unwrap_or_inf(self) -> T {

+        use self::RangeErrorKind::*;

+        match self.map_err(Into::into) {

+            Ok(v) => v,

+            Err(NegOverflow) => T::neg_infinity(),

+            Err(PosOverflow) => T::pos_infinity(),

+        }

+    }

+}

+

+impl<T, E> UnwrapOrInvalid for Result<T, E>

+where T: InvalidSentinel {

+    type Output = T;

+    #[inline]

+    fn unwrap_or_invalid(self) -> T {

+        match self {

+            Ok(v) => v,

+            Err(..) => T::invalid_sentinel(),

+        }

+    }

+}

+

+impl<T, E> UnwrapOrSaturate for Result<T, E>

+where T: Saturated, E: Into<RangeErrorKind> {

+    type Output = T;

+    #[inline]

+    fn unwrap_or_saturate(self) -> T {

+        use self::RangeErrorKind::*;

+        match self.map_err(Into::into) {

+            Ok(v) => v,

+            Err(NegOverflow) => T::saturated_min(),

+            Err(PosOverflow) => T::saturated_max(),

+        }

+    }

+}

diff --git a/vendor/conv-0.3.3/src/impls.rs b/vendor/conv-0.3.3/src/impls.rs
new file mode 100644
index 0000000..424ee83
--- /dev/null
+++ b/vendor/conv-0.3.3/src/impls.rs
@@ -0,0 +1,591 @@
+macro_rules! max_of {

+    ($name:ident) => { ::std::$name::MAX };

+}

+

+macro_rules! min_of {

+    ($name:ident) => { ::std::$name::MIN };

+}

+

+macro_rules! approx_blind {

+    (($($attrs:tt)*), $src:ty, $dst:ty, $scheme:ty) => {

+        as_item! {

+            $($attrs)*

+            impl ::ApproxFrom<$src, $scheme> for $dst {

+                type Err = ::errors::NoError;

+                #[inline]

+                fn approx_from(src: $src) -> Result<$dst, Self::Err> {

+                    Ok(src as $dst)

+                }

+            }

+        }

+    };

+}

+

+macro_rules! approx_z_to_dmax {

+    (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => {

+        as_item! {

+            $($attrs)*

+            impl ::ApproxFrom<$src, $scheme> for $dst {

+                type Err = ::errors::RangeError<$src>;

+                #[inline]

+                fn approx_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(0 <= src) {

+                        return Err(::errors::RangeError::NegOverflow(src));

+                    }

+                    if !(src <= max_of!($dst) as $src) {

+                        return Err(::errors::RangeError::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+    };

+}

+

+macro_rules! approx_to_dmax {

+    (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => {

+        as_item! {

+            $($attrs)*

+            impl ::ApproxFrom<$src, $scheme> for $dst {

+                type Err = ::errors::PosOverflow<$src>;

+                #[inline]

+                fn approx_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(src <= max_of!($dst) as $src) {

+                        return Err(::errors::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+    };

+}

+

+macro_rules! approx_dmin_to_dmax {

+    (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => {

+        as_item! {

+            $($attrs)*

+            impl ::ApproxFrom<$src, $scheme> for $dst {

+                type Err = ::errors::RangeError<$src>;

+                #[inline]

+                fn approx_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(min_of!($dst) as $src <= src) {

+                        return Err(::errors::RangeError::NegOverflow(src));

+                    }

+                    if !(src <= max_of!($dst) as $src) {

+                        return Err(::errors::RangeError::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+    }

+}

+

+macro_rules! approx_z_up {

+    (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => {

+        as_item! {

+            $($attrs)*

+            impl ::ApproxFrom<$src, $scheme> for $dst {

+                type Err = ::errors::NegOverflow<$src>;

+                #[inline]

+                fn approx_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(0 <= src) {

+                        return Err(::errors::NegOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+    };

+}

+

+macro_rules! approx_dmin_to_dmax_no_nan {

+    (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty) => {

+        approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, $scheme, approx: |s| s }

+    };

+

+    (($($attrs:tt)*), $src:ty, $dst:ident, $scheme:ty, approx: |$src_name:ident| $conv:expr) => {

+        approx_range_no_nan! {

+            ($($attrs)*), $src,

+            $dst, [min_of!($dst) as $src, max_of!($dst) as $src],

+            $scheme, approx: |$src_name| $conv

+        }

+    };

+}

+

+macro_rules! approx_range_no_nan {

+    (($($attrs:tt)*), $src:ty, $dst:ident, [$min:expr, $max:expr], $scheme:ty) => {

+        approx_range_no_nan! { ($($attrs)*), $src, $dst,  [$min, $max], $scheme, approx: |s| s }

+    };

+

+    (($($attrs:tt)*), $src:ty, $dst:ident, [$min:expr, $max:expr], $scheme:ty, approx: |$src_name:ident| $conv:expr) => {

+        as_item! {

+            $($attrs)*

+            impl ::ApproxFrom<$src, $scheme> for $dst {

+                type Err = ::errors::FloatError<$src>;

+                #[inline]

+                fn approx_from(src: $src) -> Result<$dst, Self::Err> {

+                    if src.is_nan() {

+                        return Err(::errors::FloatError::NotANumber(src));

+                    }

+                    let approx = { let $src_name = src; $conv };

+                    if !($min <= approx) {

+                        return Err(::errors::FloatError::NegOverflow(src));

+                    }

+                    if !(approx <= $max) {

+                        return Err(::errors::FloatError::PosOverflow(src));

+                    }

+                    Ok(approx as $dst)

+                }

+            }

+        }

+    };

+}

+

+macro_rules! num_conv {

+    (@ $src:ty=> $(,)*) => {};

+

+    (@ $src:ty=> #[32] $($tail:tt)*) => {

+        num_conv! { @ $src=> (#[cfg(target_pointer_width="32")]) $($tail)* }

+    };

+

+    (@ $src:ty=> #[64] $($tail:tt)*) => {

+        num_conv! { @ $src=> (#[cfg(target_pointer_width="64")]) $($tail)* }

+    };

+

+    (@ $src:ty=> e   $($tail:tt)*) => { num_conv! { @ $src=> () e   $($tail)* } };

+    (@ $src:ty=> n+  $($tail:tt)*) => { num_conv! { @ $src=> () n+  $($tail)* } };

+    (@ $src:ty=> n   $($tail:tt)*) => { num_conv! { @ $src=> () n   $($tail)* } };

+    (@ $src:ty=> w+  $($tail:tt)*) => { num_conv! { @ $src=> () w+  $($tail)* } };

+    (@ $src:ty=> w   $($tail:tt)*) => { num_conv! { @ $src=> () w   $($tail)* } };

+    (@ $src:ty=> aW  $($tail:tt)*) => { num_conv! { @ $src=> () aW  $($tail)* } };

+    (@ $src:ty=> nf  $($tail:tt)*) => { num_conv! { @ $src=> () nf  $($tail)* } };

+    (@ $src:ty=> fan $($tail:tt)*) => { num_conv! { @ $src=> () fan $($tail)* } };

+

+    // Exact conversion

+    (@ $src:ty=> ($($attrs:tt)*) e $dst:ty, $($tail:tt)*) => {

+        as_item! {

+            approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+            approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::NoError;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    // Narrowing a signed type *into* an unsigned type where the destination type's maximum value is representable by the source type.

+    (@ $src:ty=> ($($attrs:tt)*) n+ $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_z_to_dmax! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+            approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::RangeError<$src>;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(0 <= src) {

+                        return Err(::errors::RangeError::NegOverflow(src));

+                    }

+                    if !(src <= max_of!($dst) as $src) {

+                        return Err(::errors::RangeError::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    // Narrowing an unsigned type *into* a type where the destination type's maximum value is representable by the source type.

+    (@ $src:ty=> ($($attrs:tt)*) n- $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_to_dmax! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+            approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::PosOverflow<$src>;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(src <= max_of!($dst) as $src) {

+                        return Err(::errors::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    // Narrowing where the destination type's bounds are representable by the source type.

+    (@ $src:ty=> ($($attrs:tt)*) n $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_dmin_to_dmax! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+            approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::RangeError<$src>;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(min_of!($dst) as $src <= src) {

+                        return Err(::errors::RangeError::NegOverflow(src));

+                    }

+                    if !(src <= max_of!($dst) as $src) {

+                        return Err(::errors::RangeError::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    // Widening a signed type *into* an unsigned type.

+    (@ $src:ty=> ($($attrs:tt)*) w+ $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_z_up! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+            approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::NegOverflow<$src>;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(0 <= src) {

+                        return Err(::errors::NegOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    // Widening.

+    (@ $src:ty=> ($($attrs:tt)*) w $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+            approx_blind! { ($($attrs)*), $src, $dst, ::Wrapping }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::NoError;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    // Narrowing *into* a floating-point type where the conversion is only exact within a given range.

+    (@ $src:ty=> ($($attrs:tt)*) nf [+- $bound:expr] $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::RangeError<$src>;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(-$bound <= src) {

+                        return Err(::errors::RangeError::NegOverflow(src));

+                    }

+                    if !(src <= $bound) {

+                        return Err(::errors::RangeError::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    (@ $src:ty=> ($($attrs:tt)*) nf [, $max:expr] $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_blind! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+

+            $($attrs)*

+            impl ::ValueFrom<$src> for $dst {

+                type Err = ::errors::PosOverflow<$src>;

+                #[inline]

+                fn value_from(src: $src) -> Result<$dst, Self::Err> {

+                    if !(src <= $max) {

+                        return Err(::errors::PosOverflow(src));

+                    }

+                    Ok(src as $dst)

+                }

+            }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    // Approximately narrowing a floating point value *into* a type where the source value is constrained by the given range of values.

+    (@ $src:ty=> ($($attrs:tt)*) fan [$min:expr, $max:expr] $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max],

+                ::DefaultApprox }

+            approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max],

+                ::RoundToNearest, approx: |s| s.round() }

+            approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max],

+                ::RoundToNegInf, approx: |s| s.floor() }

+            approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max],

+                ::RoundToPosInf, approx: |s| s.ceil() }

+            approx_range_no_nan! { ($($attrs)*), $src, $dst, [$min, $max],

+                ::RoundToZero, approx: |s| s.trunc() }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    (@ $src:ty=> ($($attrs:tt)*) fan $dst:ident, $($tail:tt)*) => {

+        as_item! {

+            approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::DefaultApprox }

+            approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToNearest,

+                approx: |s| s.round() }

+            approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToNegInf,

+                approx: |s| s.floor() }

+            approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToPosInf,

+                approx: |s| s.ceil() }

+            approx_dmin_to_dmax_no_nan! { ($($attrs)*), $src, $dst, ::RoundToZero,

+                approx: |s| s.trunc() }

+        }

+        num_conv! { @ $src=> $($tail)* }

+    };

+

+    ($src:ty=> $($tail:tt)*) => {

+        num_conv! { @ $src=> $($tail)*, }

+    };

+}

+

+mod lang_ints {

+    num_conv! { i8=>  w i16, w i32, w i64, w+u8, w+u16, w+u32, w+u64, w isize, w+usize }

+    num_conv! { i16=> n i8, w i32, w i64, n+u8, w+u16, w+u32, w+u64, w isize, w+usize }

+    num_conv! { i32=> n i8, n i16, w i64, n+u8, n+u16, w+u32, w+u64 }

+    num_conv! { i64=> n i8, n i16, n i32, n+u8, n+u16, n+u32, w+u64 }

+    num_conv! { i32=> #[32] e isize, #[64] w isize, w+usize }

+    num_conv! { i64=> #[32] n isize, #[64] e isize, #[32] n+usize, #[64] w+usize }

+

+    num_conv! { u8=> n-i8, w i16, w i32, w i64, w u16, w u32, w u64, w isize, w usize }

+    num_conv! { u16=> n-i8, n-i16, w i32, w i64, n-u8, w u32, w u64, w isize, w usize }

+    num_conv! { u32=> n-i8, n-i16, n-i32, w i64, n-u8, n-u16, w u64 }

+    num_conv! { u64=> n-i8, n-i16, n-i32, n-i64, n-u8, n-u16, n-u32 }

+    num_conv! { u32=> #[32] n-isize, #[64] w isize, #[32] e usize, #[64] w usize }

+    num_conv! { u64=> n-isize, #[32] n-usize, #[64] e usize }

+

+    num_conv! { isize=> n i8, n i16, #[32] e i32, #[32] w i64, #[64] n i32, #[64] e i64 }

+    num_conv! { isize=> n+u8, n+u16, #[32] w+u32, #[32] w+u64, #[64] n+u32, #[64] w+u64 }

+    num_conv! { isize=> w+usize }

+

+    num_conv! { usize=> n-i8, n-i16, #[32] n-i32, #[32] w i64, #[64] n-i32, #[64] n-i64 }

+    num_conv! { usize=> n-u8, n-u16, #[32] e u32, #[32] w u64, #[64] n-u32, #[64] e u64 }

+    num_conv! { usize=> n-isize }

+}

+

+mod lang_floats {

+    use {ApproxFrom, ApproxScheme};

+    use ValueFrom;

+    use errors::{NoError, RangeError};

+

+    // f32 -> f64: strictly widening

+    impl<Scheme> ApproxFrom<f32, Scheme> for f64

+    where Scheme: ApproxScheme {

+        type Err = NoError;

+        #[inline]

+        fn approx_from(src: f32) -> Result<f64, Self::Err> {

+            Ok(src as f64)

+        }

+    }

+

+    impl ValueFrom<f32> for f64 {

+        type Err = NoError;

+        #[inline]

+        fn value_from(src: f32) -> Result<f64, Self::Err> {

+            Ok(src as f64)

+        }

+    }

+

+    // f64 -> f32: narrowing, approximate

+    impl ApproxFrom<f64> for f32 {

+        type Err = RangeError<f64>;

+        #[inline]

+        fn approx_from(src: f64) -> Result<f32, Self::Err> {

+            if !src.is_finite() {

+                return Ok(src as f32);

+            }

+            if !(::std::f32::MIN as f64 <= src) {

+                return Err(RangeError::NegOverflow(src));

+            }

+            if !(src <= ::std::f32::MAX as f64) {

+                return Err(RangeError::PosOverflow(src));

+            }

+            Ok(src as f32)

+        }

+    }

+}

+

+mod lang_int_to_float {

+    num_conv! { i8=>  w f32, w f64 }

+    num_conv! { i16=> w f32, w f64 }

+    num_conv! { i32=> nf [+- 16_777_216] f32, w f64 }

+    num_conv! { i64=> nf [+- 16_777_216] f32, nf [+- 9_007_199_254_740_992] f64 }

+

+    num_conv! { u8=>  w f32, w f64 }

+    num_conv! { u16=> w f32, w f64 }

+    num_conv! { u32=> nf [, 16_777_216] f32, w f64 }

+    num_conv! { u64=> nf [, 16_777_216] f32, nf [, 9_007_199_254_740_992] f64 }

+

+    num_conv! { isize=> nf [+- 16_777_216] f32,

+        #[32] w f64, #[64] nf [+- 9_007_199_254_740_992] f64 }

+    num_conv! { usize=> nf [, 16_777_216] f32,

+        #[32] w f64, #[64] nf [, 9_007_199_254_740_992] f64 }

+}

+

+mod lang_float_to_int {

+    /*

+    We use explicit ranges on narrowing float-to-int conversions because it *turns out* that just because you can cast an integer to a float, this *does not* mean you can cast it back and get the original input.  The non-explicit-range implementation of `fan` *depends* on this, so it was kinda *totally broken* for narrowing conversions.

+

+    *Yeah.*  That's floating point for you!

+    */

+    num_conv! { f32=> fan i8, fan i16,

+        fan [-2.1474836e9, 2.1474835e9] i32,

+        fan [-9.223372e18, 9.2233715e18] i64 }

+    num_conv! { f32=> fan u8, fan u16,

+        fan [0.0, 4.294967e9] u32,

+        fan [0.0, 1.8446743e19] u64 }

+    num_conv! { f32=>

+        #[32] fan [-2.1474836e9, 2.1474835e9] isize,

+        #[32] fan [0.0, 4.294967e9] usize,

+        #[64] fan [-9.223372e18, 9.2233715e18] isize,

+        #[64] fan [0.0, 1.8446743e19] usize }

+

+    num_conv! { f64=> fan i8, fan i16, fan i32,

+        fan [-9.223372036854776e18, 9.223372036854775e18] i64 }

+    num_conv! { f64=> fan u8, fan u16, fan u32,

+        fan [0.0, 1.844674407370955e19] u64 }

+    num_conv! { f64=>

+        #[32] fan isize, #[32] fan usize,

+        #[64] fan [-9.223372036854776e18, 9.223372036854775e18] isize,

+        #[64] fan [0.0, 1.844674407370955e19] usize }

+}

+

+mod lang_char_to_int {

+    use TryFrom;

+    use ValueFrom;

+    use errors::{NoError, PosOverflow};

+

+    impl TryFrom<char> for u32 {

+        type Err = NoError;

+        #[inline]

+        fn try_from(src: char) -> Result<u32, Self::Err> {

+            Ok(src as u32)

+        }

+    }

+

+    impl TryFrom<char> for usize {

+        type Err = NoError;

+        #[inline]

+        fn try_from(src: char) -> Result<usize, Self::Err> {

+            Ok(src as usize)

+        }

+    }

+

+    impl TryFrom<char> for isize {

+        type Err = NoError;

+        #[inline]

+        fn try_from(src: char) -> Result<isize, Self::Err> {

+            Ok(src as isize)

+        }

+    }

+

+    macro_rules! conv_char_to_int {

+        ($($ts:ty),* $(,)*) => {

+            $(

+                impl TryFrom<char> for $ts {

+                    type Err = PosOverflow<char>;

+                    #[inline]

+                    fn try_from(src: char) -> Result<$ts, Self::Err> {

+                        <$ts as ValueFrom<_>>::value_from(src as u32)

+                            .map_err(|_| PosOverflow(src))

+                    }

+                }

+            )*

+        };

+    }

+

+    macro_rules! conv_char_to_int_wide {

+        ($($ts:ty),* $(,)*) => {

+            $(

+                impl TryFrom<char> for $ts {

+                    type Err = NoError;

+                    #[inline]

+                    fn try_from(src: char) -> Result<$ts, Self::Err> {

+                        <$ts as ValueFrom<_>>::value_from(src as u32)

+                    }

+                }

+            )*

+        };

+    }

+

+    conv_char_to_int! { i8, i16, i32, u8, u16 }

+    conv_char_to_int_wide! { i64, u64 }

+}

+

+mod lang_int_to_char {

+    use TryFrom;

+    use ValueFrom;

+    use errors::{NoError, Unrepresentable, UnwrapOk};

+

+    impl TryFrom<u8> for char {

+        type Err = NoError;

+        #[inline]

+        fn try_from(src: u8) -> Result<char, Self::Err> {

+            Ok(src as char)

+        }

+    }

+    impl TryFrom<u16> for char {

+        type Err = Unrepresentable<u16>;

+        #[inline]

+        fn try_from(src: u16) -> Result<char, Self::Err> {

+            TryFrom::try_from(

+                <u32 as ValueFrom<_>>::value_from(src).unwrap_ok()

+            ).map_err(|_| Unrepresentable(src))

+        }

+    }

+

+    impl TryFrom<u32> for char {

+        type Err = Unrepresentable<u32>;

+        #[inline]

+        fn try_from(src: u32) -> Result<char, Self::Err> {

+            ::std::char::from_u32(src).ok_or_else(|| Unrepresentable(src))

+        }

+    }

+

+    macro_rules! conv_int_to_char {

+        ($($ts:ty),* $(,)*) => {

+            $(

+                impl TryFrom<$ts> for char {

+                    type Err = Unrepresentable<$ts>;

+                    #[inline]

+                    fn try_from(src: $ts) -> Result<char, Self::Err> {

+                        <u32 as ValueFrom<_>>::value_from(src)

+                            .map_err(|_| Unrepresentable(src))

+                            .and_then(|usv| TryFrom::try_from(usv)

+                                .map_err(|_| Unrepresentable(src)))

+                    }

+                }

+            )*

+        };

+    }

+

+    conv_int_to_char! { i8, i16, i32, i64, isize, u64, usize }

+}

diff --git a/vendor/conv-0.3.3/src/lib.rs b/vendor/conv-0.3.3/src/lib.rs
new file mode 100644
index 0000000..195b8d1
--- /dev/null
+++ b/vendor/conv-0.3.3/src/lib.rs
@@ -0,0 +1,525 @@
+/*!

+This crate provides a number of conversion traits with more specific semantics than those provided by `as` or `From`/`Into`.

+

+The goal with the traits provided here is to be more specific about what generic code can rely on, as well as provide reasonably self-describing alternatives to the standard `From`/`Into` traits.  For example, the although `T: From<U>` might be satisfied, it imposes no restrictions on the *kind* of conversion being implemented.  As such, the traits in this crate try to be very specific about what conversions are allowed.  This makes them less generally applicable, but more useful where they *do* apply.

+

+In addition, `From`/`Into` requires all conversions to succeed or panic.  All conversion traits in this crate define an associated error type, allowing code to react to failed conversions as appropriate.

+

+<style type="text/css">

+.link-block { font-family: "Fira Sans"; }

+.link-block > p { display: inline-block; }

+.link-block > p > strong { font-weight: 500; margin-right: 1em; }

+.link-block > ul { display: inline-block; padding: 0; list-style: none; }

+.link-block > ul > li {

+  font-size: 0.8em;

+  background-color: #eee;

+  border: 1px solid #ccc;

+  padding: 0.3em;

+  display: inline-block;

+}

+</style>

+<span></span><div class="link-block">

+

+**Links**

+

+* [Latest Release](https://crates.io/crates/scan-rules/)

+* [Latest Docs](https://danielkeep.github.io/rust-scan-rules/doc/scan_rules/index.html)

+* [Repository](https://github.com/DanielKeep/rust-scan-rules)

+

+<span></span></div>

+

+## Compatibility

+

+`conv` is compatible with Rust 1.2 and higher.

+

+## Change Log

+

+### v0.3.2

+

+- Added integer ↔ `char` conversions.

+- Added missing `isize`/`usize` → `f32`/`f64` conversions.

+- Fixed the error type of `i64` → `usize` for 64-bit targets.

+

+### v0.3.1

+

+- Change to `unwrap_ok` for better codegen (thanks bluss).

+- Fix for Rust breaking change (code in question was dodgy anyway; thanks m4rw3r).

+

+### v0.3.0

+

+- Added an `Error` constraint to all `Err` associated types.  This will break any user-defined conversions where the `Err` type does not implement `Error`.

+- Renamed the `Overflow` and `Underflow` errors to `PosOverflow` and `NegOverflow` respectively.  In the context of floating point conversions, "underflow" usually means the value was too close to zero to correctly represent.

+

+### v0.2.1

+

+- Added `ConvUtil::into_as<Dst>` as a shortcut for `Into::<Dst>::into`.

+- Added `#[inline]` attributes.

+- Added `Saturate::saturate`, which can saturate `Result`s arising from over/underflow.

+

+### v0.2.0

+

+- Changed all error types to include the original input as payload.  This breaks pretty much *everything*.  Sorry about that.  On the bright side, there's now no downside to using the conversion traits for non-`Copy` types.

+- Added the normal rounding modes for float → int approximations: `RoundToNearest`, `RoundToNegInf`, `RoundToPosInf`, and `RoundToZero`.

+- `ApproxWith` is now subsumed by a pair of extension traits (`ConvUtil` and `ConvAsUtil`), that also have shortcuts for `TryInto` and `ValueInto` so that you can specify the destination type on the method.

+

+# Overview

+

+The following traits are used to define various conversion semantics:

+

+- [`ApproxFrom`](./trait.ApproxFrom.html)/[`ApproxInto`](./trait.ApproxInto.html) - approximate conversions, with selectable approximation scheme (see [`ApproxScheme`](./trait.ApproxScheme.html)).

+- [`TryFrom`](./trait.TryFrom.html)/[`TryInto`](./trait.TryInto.html) - general, potentially failing value conversions.

+- [`ValueFrom`](./trait.ValueFrom.html)/[`ValueInto`](./trait.ValueInto.html) - exact, value-preserving conversions.

+

+When *defining* a conversion, try to implement the `*From` trait variant where possible.  When *using* a conversion, try to depend on the `*Into` trait variant where possible.  This is because the `*Into` traits automatically use `*From` implementations, but not the reverse.  Implementing `*From` and using `*Into` ensures conversions work in as many contexts as possible.

+

+These extension methods are provided to help with some common cases:

+

+- [`ConvUtil::approx_as<Dst>`](./trait.ConvUtil.html#method.approx_as) - approximates to `Dst` with the `DefaultApprox` scheme.

+- [`ConvUtil::approx_as_by<Dst, S>`](./trait.ConvUtil.html#method.approx_as_by) - approximates to `Dst` with the scheme `S`.

+- [`ConvUtil::into_as<Dst>`](./trait.ConvUtil.html#method.into_as) - converts to `Dst` using `Into::into`.

+- [`ConvUtil::try_as<Dst>`](./trait.ConvUtil.html#method.try_as) - converts to `Dst` using `TryInto::try_into`.

+- [`ConvUtil::value_as<Dst>`](./trait.ConvUtil.html#method.value_as) - converts to `Dst` using `ValueInto::value_into`.

+- [`ConvAsUtil::approx`](./trait.ConvAsUtil.html#method.approx) - approximates to an inferred destination type with the `DefaultApprox` scheme.

+- [`ConvAsUtil::approx_by<S>`](./trait.ConvAsUtil.html#method.approx_by) - approximates to an inferred destination type with the scheme `S`.

+- [`Saturate::saturate`](./errors/trait.Saturate.html#tymethod.saturate) - saturates on overflow.

+- [`UnwrapOk::unwrap_ok`](./errors/trait.UnwrapOk.html#tymethod.unwrap_ok) - unwraps results from conversions that cannot fail.

+- [`UnwrapOrInf::unwrap_or_inf`](./errors/trait.UnwrapOrInf.html#tymethod.unwrap_or_inf) - saturates to ±∞ on failure.

+- [`UnwrapOrInvalid::unwrap_or_invalid`](./errors/trait.UnwrapOrInvalid.html#tymethod.unwrap_or_invalid) - substitutes the target type's "invalid" sentinel value on failure.

+- [`UnwrapOrSaturate::unwrap_or_saturate`](./errors/trait.UnwrapOrSaturate.html#tymethod.unwrap_or_saturate) - saturates to the maximum or minimum value of the target type on failure.

+

+A macro is provided to assist in implementing conversions:

+

+- [`TryFrom!`](./macros/index.html#tryfrom!) - derives an implementation of [`TryFrom`](./trait.TryFrom.html).

+

+If you are implementing your own types, you may also be interested in the traits contained in the [`misc`](./misc/index.html) module.

+

+## Provided Implementations

+

+The crate provides several blanket implementations:

+

+- `*From<A> for A` (all types can be converted from and into themselves).

+- `*Into<Dst> for Src where Dst: *From<Src>` (`*From` implementations imply a matching `*Into` implementation).

+

+Conversions for the builtin numeric (integer and floating point) types are provided.  In general, `ValueFrom` conversions exist for all pairs except for float → integer (since such a conversion is generally unlikely to *exactly* succeed) and `f64 → f32` (for the same reason).  `ApproxFrom` conversions with the `DefaultApprox` scheme exist between all pairs.  `ApproxFrom` with the `Wrapping` scheme exist between integers.

+

+## Errors

+

+A number of error types are defined in the [`errors`](./errors/index.html) module.  Generally, conversions use whichever error type most *narrowly* defines the kinds of failures that can occur.  For example:

+

+- `ValueFrom<u8> for u16` cannot possibly fail, and as such it uses `NoError`.

+- `ValueFrom<i8> for u16` can *only* fail with a negative overflow, thus it uses the `NegOverflow` type.

+- `ValueFrom<i32> for u16` can overflow in either direction, hence it uses `RangeError`.

+- Finally, `ApproxFrom<f32> for u16` can overflow (positive or negative), or attempt to convert NaN; `FloatError` covers those three cases.

+

+Because there are *numerous* error types, the `GeneralError` enum is provided.  `From<E, T> for GeneralError<T>` exists for each error type `E<T>` defined by this crate (even for `NoError`!), allowing errors to be translated automatically by `try!`.  In fact, all errors can be "expanded" to *all* more general forms (*e.g.* `NoError` → `NegOverflow`, `PosOverflow` → `RangeError` → `FloatError`).

+

+Aside from `NoError`, the various error types wrap the input value that you attempted to convert.  This is so that non-`Copy` types do not need to be pre-emptively cloned prior to conversion, just in case the conversion fails.  A downside is that this means there are many, *many* incompatible error types.

+

+To help alleviate this, there is also `GeneralErrorKind`, which is simply `GeneralError<T>` without the payload, and all errors can be converted into it directly.

+

+The reason for not just using `GeneralErrorKind` in the first place is to statically reduce the number of potential error cases you need to deal with.  It also allows the `Unwrap*` extension traits to be defined *without* the possibility for runtime failure (*e.g.* you cannot use `unwrap_or_saturate` with a `FloatError`, because what do you do if the error is `NotANumber`; saturate to max or to min?  Or panic?).

+

+# Examples

+

+```

+# extern crate conv;

+# use conv::*;

+# fn main() {

+// This *cannot* fail, so we can use `unwrap_ok` to discard the `Result`.

+assert_eq!(u8::value_from(0u8).unwrap_ok(), 0u8);

+

+// This *can* fail.  Specifically, it can overflow toward negative infinity.

+assert_eq!(u8::value_from(0i8),     Ok(0u8));

+assert_eq!(u8::value_from(-1i8),    Err(NegOverflow(-1)));

+

+// This can overflow in *either* direction; hence the change to `RangeError`.

+assert_eq!(u8::value_from(-1i16),   Err(RangeError::NegOverflow(-1)));

+assert_eq!(u8::value_from(0i16),    Ok(0u8));

+assert_eq!(u8::value_from(256i16),  Err(RangeError::PosOverflow(256)));

+

+// We can use the extension traits to simplify this a little.

+assert_eq!(u8::value_from(-1i16).unwrap_or_saturate(),  0u8);

+assert_eq!(u8::value_from(0i16).unwrap_or_saturate(),   0u8);

+assert_eq!(u8::value_from(256i16).unwrap_or_saturate(), 255u8);

+

+// Obviously, all integers can be "approximated" using the default scheme (it

+// doesn't *do* anything), but they can *also* be approximated with the

+// `Wrapping` scheme.

+assert_eq!(

+    <u8 as ApproxFrom<_, DefaultApprox>>::approx_from(400u16),

+    Err(PosOverflow(400)));

+assert_eq!(

+    <u8 as ApproxFrom<_, Wrapping>>::approx_from(400u16),

+    Ok(144u8));

+

+// This is rather inconvenient; as such, there are a number of convenience

+// extension methods available via `ConvUtil` and `ConvAsUtil`.

+assert_eq!(400u16.approx(),                       Err::<u8, _>(PosOverflow(400)));

+assert_eq!(400u16.approx_by::<Wrapping>(),        Ok::<u8, _>(144u8));

+assert_eq!(400u16.approx_as::<u8>(),              Err(PosOverflow(400)));

+assert_eq!(400u16.approx_as_by::<u8, Wrapping>(), Ok(144));

+

+// Integer -> float conversions *can* fail due to limited precision.

+// Once the continuous range of exactly representable integers is exceeded, the

+// provided implementations fail with overflow errors.

+assert_eq!(f32::value_from(16_777_216i32), Ok(16_777_216.0f32));

+assert_eq!(f32::value_from(16_777_217i32), Err(RangeError::PosOverflow(16_777_217)));

+

+// Float -> integer conversions have to be done using approximations.  Although

+// exact conversions are *possible*, "advertising" this with an implementation

+// is misleading.

+//

+// Note that `DefaultApprox` for float -> integer uses whatever rounding

+// mode is currently active (*i.e.* whatever `as` would do).

+assert_eq!(41.0f32.approx(), Ok(41u8));

+assert_eq!(41.3f32.approx(), Ok(41u8));

+assert_eq!(41.5f32.approx(), Ok(41u8));

+assert_eq!(41.8f32.approx(), Ok(41u8));

+assert_eq!(42.0f32.approx(), Ok(42u8));

+

+assert_eq!(255.0f32.approx(), Ok(255u8));

+assert_eq!(256.0f32.approx(), Err::<u8, _>(FloatError::PosOverflow(256.0)));

+

+// Sometimes, it can be useful to saturate the conversion from float to

+// integer directly, then account for NaN as input separately.  The `Saturate`

+// extension trait exists for this reason.

+assert_eq!((-23.0f32).approx_as::<u8>().saturate(), Ok(0));

+assert_eq!(302.0f32.approx_as::<u8>().saturate(), Ok(255u8));

+assert!(std::f32::NAN.approx_as::<u8>().saturate().is_err());

+

+// If you really don't care about the specific kind of error, you can just rely

+// on automatic conversion to `GeneralErrorKind`.

+fn too_many_errors() -> Result<(), GeneralErrorKind> {

+    assert_eq!({let r: u8 = try!(0u8.value_into()); r},  0u8);

+    assert_eq!({let r: u8 = try!(0i8.value_into()); r},  0u8);

+    assert_eq!({let r: u8 = try!(0i16.value_into()); r}, 0u8);

+    assert_eq!({let r: u8 = try!(0.0f32.approx()); r},   0u8);

+    Ok(())

+}

+# let _ = too_many_errors();

+# }

+```

+

+*/

+

+#![deny(missing_docs)]

+

+#[macro_use] extern crate custom_derive;

+

+// Exported macros.

+pub mod macros;

+

+pub use errors::{

+    NoError, GeneralError, GeneralErrorKind, Unrepresentable,

+    NegOverflow, PosOverflow,

+    FloatError, RangeError, RangeErrorKind,

+    Saturate,

+    UnwrapOk, UnwrapOrInf, UnwrapOrInvalid, UnwrapOrSaturate,

+};

+

+use std::error::Error;

+

+/**

+Publicly re-exports the most generally useful set of items.

+

+Usage of the prelude should be considered **unstable**.  Although items will likely *not* be removed without bumping the major version, new items *may* be added, which could potentially cause name conflicts in user code.

+*/

+pub mod prelude {

+    pub use super::{

+        ApproxFrom, ApproxInto,

+        ValueFrom, ValueInto,

+        GeneralError, GeneralErrorKind,

+        Saturate,

+        UnwrapOk, UnwrapOrInf, UnwrapOrInvalid, UnwrapOrSaturate,

+        ConvUtil, ConvAsUtil,

+        RoundToNearest, RoundToZero, Wrapping,

+    };

+}

+

+macro_rules! as_item {

+    ($($i:item)*) => {$($i)*};

+}

+

+macro_rules! item_for_each {

+    (

+        $( ($($arg:tt)*) ),* $(,)* => { $($exp:tt)* }

+    ) => {

+        macro_rules! body {

+            $($exp)*

+        }

+

+        $(

+            body! { $($arg)* }

+        )*

+    };

+}

+

+pub mod errors;

+pub mod misc;

+

+mod impls;

+

+/**

+This trait is used to perform a conversion that is permitted to approximate the result, but *not* to wrap or saturate the result to fit into the destination type's representable range.

+

+Where possible, prefer *implementing* this trait over `ApproxInto`, but prefer *using* `ApproxInto` for generic constraints.

+

+# Details

+

+All implementations of this trait must provide a conversion that can be separated into two logical steps: an approximation transform, and a representation transform.

+

+The "approximation transform" step involves transforming the input value into an approximately equivalent value which is supported by the target type *without* taking the target type's representable range into account.  For example, this might involve rounding or truncating a floating point value to an integer, or reducing the accuracy of a floating point value.

+

+The "representation transform" step *exactly* rewrites the value from the source type's binary representation into the destination type's binary representation.  This step *may not* transform the value in any way.  If the result of the approximation is not representable, the conversion *must* fail.

+

+The major reason for this formulation is to exactly define what happens when converting between floating point and integer types.  Often, it is unclear what happens to floating point values beyond the range of the target integer type.  Do they saturate, wrap, or cause a failure?

+

+With this formulation, it is well-defined: if a floating point value is outside the representable range, the conversion fails.  This allows users to distinguish between approximation and range violation, and act accordingly.

+*/

+pub trait ApproxFrom<Src, Scheme=DefaultApprox>: Sized where Scheme: ApproxScheme {

+    /// The error type produced by a failed conversion.

+    type Err: Error;

+

+    /// Convert the given value into an approximately equivalent representation.

+    fn approx_from(src: Src) -> Result<Self, Self::Err>;

+}

+

+impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where Scheme: ApproxScheme {

+    type Err = NoError;

+    fn approx_from(src: Src) -> Result<Self, Self::Err> {

+        Ok(src)

+    }

+}

+

+/**

+This is the dual of `ApproxFrom`; see that trait for information.

+

+Where possible, prefer *using* this trait over `ApproxFrom` for generic constraints, but prefer *implementing* `ApproxFrom`.

+*/

+pub trait ApproxInto<Dst, Scheme=DefaultApprox> where Scheme: ApproxScheme {

+    /// The error type produced by a failed conversion.

+    type Err: Error;

+

+    /// Convert the subject into an approximately equivalent representation.

+    fn approx_into(self) -> Result<Dst, Self::Err>;

+}

+

+impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src

+where

+    Dst: ApproxFrom<Src, Scheme>,

+    Scheme: ApproxScheme,

+{

+    type Err = Dst::Err;

+    fn approx_into(self) -> Result<Dst, Self::Err> {

+        ApproxFrom::approx_from(self)

+    }

+}

+

+/**

+This trait is used to mark approximation scheme types.

+*/

+pub trait ApproxScheme {}

+

+/**

+The "default" approximation scheme.  This scheme does whatever would generally be expected of a lossy conversion, assuming no additional context or instruction is given.

+

+This is a double-edged sword: it has the loosest semantics, but is far more likely to exist than more complicated approximation schemes.

+*/

+pub enum DefaultApprox {}

+impl ApproxScheme for DefaultApprox {}

+

+/**

+This scheme is used to convert a value by "wrapping" it into a narrower range.

+

+In abstract, this can be viewed as the opposite of rounding: rather than preserving the most significant bits of a value, it preserves the *least* significant bits of a value.

+*/

+pub enum Wrapping {}

+impl ApproxScheme for Wrapping {}

+

+/**

+This scheme is used to convert a value by rounding it to the nearest representable value, with ties rounding away from zero.

+*/

+pub enum RoundToNearest {}

+impl ApproxScheme for RoundToNearest {}

+

+/**

+This scheme is used to convert a value by rounding it toward negative infinity to the nearest representable value.

+*/

+pub enum RoundToNegInf {}

+impl ApproxScheme for RoundToNegInf {}

+

+/**

+This scheme is used to convert a value by rounding it toward positive infinity to the nearest representable value.

+*/

+pub enum RoundToPosInf {}

+impl ApproxScheme for RoundToPosInf {}

+

+/**

+This scheme is used to convert a value by rounding it toward zero to the nearest representable value.

+*/

+pub enum RoundToZero {}

+impl ApproxScheme for RoundToZero {}

+

+/**

+This trait is used to perform a conversion between different semantic types which might fail.

+

+Where possible, prefer *implementing* this trait over `TryInto`, but prefer *using* `TryInto` for generic constraints.

+

+# Details

+

+Typically, this should be used in cases where you are converting between values whose ranges and/or representations only partially overlap.  That the conversion may fail should be a reasonably expected outcome.  A standard example of this is converting from integers to enums of unitary variants.

+*/

+pub trait TryFrom<Src>: Sized {

+    /// The error type produced by a failed conversion.

+    type Err: Error;

+

+    /// Convert the given value into the subject type.

+    fn try_from(src: Src) -> Result<Self, Self::Err>;

+}

+

+impl<Src> TryFrom<Src> for Src {

+    type Err = NoError;

+    fn try_from(src: Src) -> Result<Self, Self::Err> {

+        Ok(src)

+    }

+}

+

+/**

+This is the dual of `TryFrom`; see that trait for information.

+

+Where possible, prefer *using* this trait over `TryFrom` for generic constraints, but prefer *implementing* `TryFrom`.

+*/

+pub trait TryInto<Dst> {

+    /// The error type produced by a failed conversion.

+    type Err: Error;

+

+    /// Convert the subject into the destination type.

+    fn try_into(self) -> Result<Dst, Self::Err>;

+}

+

+impl<Src, Dst> TryInto<Dst> for Src where Dst: TryFrom<Src> {

+    type Err = Dst::Err;

+    fn try_into(self) -> Result<Dst, Self::Err> {

+        TryFrom::try_from(self)

+    }

+}

+

+/**

+This trait is used to perform an exact, value-preserving conversion.

+

+Where possible, prefer *implementing* this trait over `ValueInto`, but prefer *using* `ValueInto` for generic constraints.

+

+# Details

+

+Implementations of this trait should be reflexive, associative and commutative (in the absence of conversion errors).  That is, all possible cycles of `ValueFrom` conversions (for which each "step" has a defined implementation) should produce the same result, with a given value either being "round-tripped" exactly, or an error being produced.

+*/

+pub trait ValueFrom<Src>: Sized {

+    /// The error type produced by a failed conversion.

+    type Err: Error;

+

+    /// Convert the given value into an exactly equivalent representation.

+    fn value_from(src: Src) -> Result<Self, Self::Err>;

+}

+

+impl<Src> ValueFrom<Src> for Src {

+    type Err = NoError;

+    fn value_from(src: Src) -> Result<Self, Self::Err> {

+        Ok(src)

+    }

+}

+

+/**

+This is the dual of `ValueFrom`; see that trait for information.

+

+Where possible, prefer *using* this trait over `ValueFrom` for generic constraints, but prefer *implementing* `ValueFrom`.

+*/

+pub trait ValueInto<Dst> {

+    /// The error type produced by a failed conversion.

+    type Err: Error;

+    

+    /// Convert the subject into an exactly equivalent representation.

+    fn value_into(self) -> Result<Dst, Self::Err>;

+}

+

+impl<Src, Dst> ValueInto<Dst> for Src where Dst: ValueFrom<Src> {

+    type Err = Dst::Err;

+    fn value_into(self) -> Result<Dst, Self::Err> {

+        ValueFrom::value_from(self)

+    }

+}

+

+/**

+This extension trait exists to simplify using various conversions.

+

+If there is more than one implementation for a given type/trait pair, a simple call to `*_into` may not be uniquely resolvable.  Due to the position of the type parameter (on the trait itself), it is cumbersome to specify the destination type.  A similar problem exists for approximation schemes.

+

+See also the [`ConvAsUtil`](./trait.ConvAsUtil.html) trait.

+

+> **Note**: There appears to be a bug in `rustdoc`'s output.  This trait is implemented *for all* types, though the methods are only available for types where the appropriate conversions are defined.

+*/

+pub trait ConvUtil {

+    /// Approximate the subject to a given type with the default scheme.

+    fn approx_as<Dst>(self) -> Result<Dst, Self::Err>

+    where Self: Sized + ApproxInto<Dst> {

+        self.approx_into()

+    }

+

+    /// Approximate the subject to a given type with a specific scheme.

+    fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>

+    where

+        Self: Sized + ApproxInto<Dst, Scheme>,

+        Scheme: ApproxScheme,

+    {

+        self.approx_into()

+    }

+

+    /// Convert the subject to a given type.

+    fn into_as<Dst>(self) -> Dst

+    where Self: Sized + Into<Dst> {

+        self.into()

+    }

+

+    /// Attempt to convert the subject to a given type.

+    fn try_as<Dst>(self) -> Result<Dst, Self::Err>

+    where Self: Sized + TryInto<Dst> {

+        self.try_into()

+    }

+

+    /// Attempt a value conversion of the subject to a given type.

+    fn value_as<Dst>(self) -> Result<Dst, Self::Err>

+    where Self: Sized + ValueInto<Dst> {

+        self.value_into()

+    }

+}

+

+impl<T> ConvUtil for T {}

+

+/**

+This extension trait exists to simplify using various conversions.

+

+If there is more than one `ApproxFrom` implementation for a given type, a simple call to `approx_into` may not be uniquely resolvable.  Due to the position of the scheme parameter (on the trait itself), it is cumbersome to specify which scheme you wanted.

+

+The destination type is inferred from context.

+

+See also the [`ConvUtil`](./trait.ConvUtil.html) trait.

+

+> **Note**: There appears to be a bug in `rustdoc`'s output.  This trait is implemented *for all* types, though the methods are only available for types where the appropriate conversions are defined.

+*/

+pub trait ConvAsUtil<Dst> {

+    /// Approximate the subject with the default scheme.

+    fn approx(self) -> Result<Dst, Self::Err>

+    where Self: Sized + ApproxInto<Dst> {

+        self.approx_into()

+    }

+

+    /// Approximate the subject with a specific scheme.

+    fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>

+    where

+        Self: Sized + ApproxInto<Dst, Scheme>,

+        Scheme: ApproxScheme,

+    {

+        self.approx_into()

+    }

+}

+

+impl<T, Dst> ConvAsUtil<Dst> for T {}

diff --git a/vendor/conv-0.3.3/src/macros.rs b/vendor/conv-0.3.3/src/macros.rs
new file mode 100644
index 0000000..f0609ec
--- /dev/null
+++ b/vendor/conv-0.3.3/src/macros.rs
@@ -0,0 +1,148 @@
+/*!

+This module provides convenience macros to help with implementing the conversion traits.

+

+# `TryFrom!`

+

+```ignore

+macro_rules! TryFrom {

+    (($target:ty) $enum:item) => { ... };

+}

+```

+

+This macro attempts to derive an implementation of the [`TryFrom`](../trait.TryFrom.html) trait.  Specifically, it supports `enum`s consisting entirely of unitary variants, with or without explicit values.  The source type can be any integer type which the variants of the enumeration can be explicitly cast to (*i.e.* using `as`).

+

+If a conversion fails (due to there being no matching variant for the specified integer value `src`), then the conversion returns `Err(Unrepresentable(src))` (see [`Unrepresentable`](../errors/struct.Unrepresentable.html)).

+

+It is compatible with the [`custom_derive!`](https://crates.io/crates/custom_derive) macro.

+

+## Example

+

+Using `custom_derive!`:

+

+```

+#[macro_use] extern crate conv;

+#[macro_use] extern crate custom_derive;

+

+custom_derive! {

+    #[derive(Debug, PartialEq, TryFrom(i32))]

+    enum Colours {

+        Red = 0,

+        Green = 5,

+        Blue

+    }

+}

+

+fn main() {

+    use conv::{TryFrom, Unrepresentable};

+

+    assert_eq!(Colours::try_from(0), Ok(Colours::Red));

+    assert_eq!(Colours::try_from(1), Err(Unrepresentable(1)));

+    assert_eq!(Colours::try_from(5), Ok(Colours::Green));

+    assert_eq!(Colours::try_from(6), Ok(Colours::Blue));

+    assert_eq!(Colours::try_from(7), Err(Unrepresentable(7)));

+}

+```

+

+The above is equivalent to the following:

+

+```

+#[macro_use] extern crate conv;

+

+#[derive(Debug, PartialEq)]

+enum Colours {

+    Red = 0,

+    Green = 5,

+    Blue

+}

+

+TryFrom! { (i32) enum Colours {

+    Red = 0,

+    Green = 5,

+    Blue

+} }

+# fn main() {}

+```

+*/

+

+/**

+See the documentation for the [`macros`](./macros/index.html#tryfrom!) module for details.

+*/

+#[macro_export]

+macro_rules! TryFrom {

+    (($prim:ty) $(pub)* enum $name:ident { $($body:tt)* }) => {

+        TryFrom! {

+            @collect_variants ($name, $prim),

+            ($($body)*,) -> ()

+        }

+    };

+

+    (

+        @collect_variants ($name:ident, $prim:ty),

+        ($(,)*) -> ($($var_names:ident,)*)

+    ) => {

+        impl $crate::TryFrom<$prim> for $name {

+            type Err = $crate::errors::Unrepresentable<$prim>;

+            fn try_from(src: $prim) -> Result<$name, Self::Err> {

+                $(

+                    if src == $name::$var_names as $prim {

+                        return Ok($name::$var_names);

+                    }

+                )*

+                Err($crate::errors::Unrepresentable(src))

+            }

+        }

+    };

+

+    (

+        @collect_variants $fixed:tt,

+        (#[$_attr:meta] $($tail:tt)*) -> $var_names:tt

+    ) => {

+        TryFrom! {

+            @skip_meta $fixed,

+            ($($tail)*) -> $var_names

+        }

+    };

+

+    (

+        @collect_variants $fixed:tt,

+        ($var:ident $(= $_val:expr)*, $($tail:tt)*) -> ($($var_names:tt)*)

+    ) => {

+        TryFrom! {

+            @collect_variants $fixed,

+            ($($tail)*) -> ($($var_names)* $var,)

+        }

+    };

+

+    (

+        @collect_variants ($name:ident),

+        ($var:ident $_struct:tt, $($tail:tt)*) -> ($($var_names:tt)*)

+    ) => {

+        const _error: () = concat!(

+            "cannot derive TryFrom for ",

+            stringify!($name),

+            ", due to non-unitary variant ",

+            stringify!($var),

+            "."

+        );

+    };

+    

+    (

+        @skip_meta $fixed:tt,

+        (#[$_attr:meta] $($tail:tt)*) -> $var_names:tt

+    ) => {

+        TryFrom! {

+            @skip_meta $fixed,

+            ($($tail)*) -> $var_names

+        }

+    };

+

+    (

+        @skip_meta $fixed:tt,

+        ($var:ident $($tail:tt)*) -> $var_names:tt

+    ) => {

+        TryFrom! {

+            @collect_variants $fixed,

+            ($var $($tail)*) -> $var_names

+        }

+    };

+}

diff --git a/vendor/conv-0.3.3/src/misc.rs b/vendor/conv-0.3.3/src/misc.rs
new file mode 100644
index 0000000..db80a53
--- /dev/null
+++ b/vendor/conv-0.3.3/src/misc.rs
@@ -0,0 +1,71 @@
+/*!

+This module defines some additional traits not *directly* tied to conversions.

+*/

+

+/**

+This trait indicates that values of a type can be logically "saturated".

+

+This is used by the `errors::UnwrapOrSaturate` extension trait.

+*/

+pub trait Saturated {

+    /// Returns the type's saturated, maximum value.

+    fn saturated_max() -> Self;

+

+    /// Returns the type's saturated, minimum value.

+    fn saturated_min() -> Self;

+}

+

+item_for_each! {

+    (i8), (i16), (i32), (i64), (u8), (u16), (u32), (u64), (isize), (usize) => {

+        ($ity:ident) => {

+            impl Saturated for $ity {

+                #[inline] fn saturated_max() -> Self { ::std::$ity::MAX }

+                #[inline] fn saturated_min() -> Self { ::std::$ity::MIN }

+            }

+        };

+    }

+}

+

+/**

+This trait indicates that a type has an "invalid" sentinel value.

+

+This is used by the `errors::UnwrapOrInvalid` extension trait.

+*/

+pub trait InvalidSentinel {

+    /// Returns the type's "invalid" sentinel value.

+    fn invalid_sentinel() -> Self;

+}

+

+item_for_each! {

+    (f32), (f64) => {

+        ($ity:ident) => {

+            impl InvalidSentinel for $ity {

+                #[inline] fn invalid_sentinel() -> Self { ::std::$ity::NAN }

+            }

+        };

+    }

+}

+

+/**

+This trait indicates that a type has positive and negative "infinity" values.

+

+This is used by the `errors::UnwrapOrInf` extension trait.

+*/

+pub trait SignedInfinity {

+    /// Returns the type's positive infinity value.

+    fn neg_infinity() -> Self;

+

+    /// Returns the type's negative infinity value.

+    fn pos_infinity() -> Self;

+}

+

+item_for_each! {

+    (f32), (f64) => {

+        ($ity:ident) => {

+            impl SignedInfinity for $ity {

+                #[inline] fn neg_infinity() -> Self { ::std::$ity::NEG_INFINITY }

+                #[inline] fn pos_infinity() -> Self { ::std::$ity::INFINITY }

+            }

+        };

+    }

+}

diff --git a/vendor/conv-0.3.3/tests/conv_utils.rs b/vendor/conv-0.3.3/tests/conv_utils.rs
new file mode 100644
index 0000000..3444ab3
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/conv_utils.rs
@@ -0,0 +1,40 @@
+#[macro_use] extern crate conv;

+

+use conv::prelude::*;

+

+#[test]

+fn test_approx() {

+    use conv::DefaultApprox;

+    assert_eq!((1.5f32).approx(), Ok(1i32));

+    assert_eq!((1.5f32).approx_by::<DefaultApprox>(), Ok(1));

+    assert_eq!((1.5f32).approx_as::<i32>(), Ok(1));

+    assert_eq!((1.5f32).approx_as_by::<i32, DefaultApprox>(), Ok(1));

+}

+

+#[test]

+fn test_into() {

+    let v = "ABC".into_as::<Vec<u8>>();

+    assert_eq!(&*v, &[0x41, 0x42, 0x43]);

+}

+

+#[test]

+fn test_try() {

+    #[derive(PartialEq, Debug)] enum ItAintRight { BabeNo, NoNo }

+    TryFrom! { (u8) enum ItAintRight { BabeNo, NoNo } }

+

+    assert_eq!(0u8.try_as::<ItAintRight>(), Ok(ItAintRight::BabeNo));

+    assert_eq!(1u8.try_as::<ItAintRight>(), Ok(ItAintRight::NoNo));

+    assert_eq!(2u8.try_as::<ItAintRight>(), Err(conv::Unrepresentable(2)));

+}

+

+#[test]

+fn test_value() {

+    assert_eq!((123u32).value_as::<u8>(), Ok(123));

+}

+

+#[test]

+fn test_whizzo() {

+    use conv::errors::Unrepresentable;

+    assert_eq!((-1.0f32).approx_as::<u8>().saturate(), Ok::<_, Unrepresentable<_>>(0u8));

+    assert_eq!((-1i32).value_as::<u8>().saturate().unwrap_ok(), 0u8);

+}

diff --git a/vendor/conv-0.3.3/tests/derive_try_from.rs b/vendor/conv-0.3.3/tests/derive_try_from.rs
new file mode 100644
index 0000000..f8e0c78
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/derive_try_from.rs
@@ -0,0 +1,45 @@
+#[macro_use] extern crate conv;

+

+use conv::{TryFrom, Unrepresentable};

+

+#[derive(Debug, PartialEq)]

+enum Get { Up, Down, AllAround }

+

+TryFrom! { (u8)

+    enum Get {

+        Up,

+        /// And

+        Down,

+        /** And */

+        AllAround

+    }

+}

+

+#[derive(Debug, PartialEq)]

+enum GottaGo { GetAway, Fast = 9000, Faster = 9001 }

+

+TryFrom! { (u16)

+    enum GottaGo {

+        GetAway,

+        Fast = 9000,

+        /// This show was stupid.

+        Faster = 9001

+    }

+}

+

+#[test]

+fn test_try_from() {

+    assert_eq!(Get::try_from(0u8), Ok(Get::Up));

+    assert_eq!(Get::try_from(1u8), Ok(Get::Down));

+    assert_eq!(Get::try_from(2u8), Ok(Get::AllAround));

+    assert_eq!(Get::try_from(3u8), Err(Unrepresentable(3u8)));

+

+    assert_eq!(GottaGo::try_from(0u16), Ok(GottaGo::GetAway));

+    assert_eq!(GottaGo::try_from(1u16), Err(Unrepresentable(1u16)));

+    assert_eq!(GottaGo::try_from(2u16), Err(Unrepresentable(2u16)));

+    assert_eq!(GottaGo::try_from(3u16), Err(Unrepresentable(3u16)));

+    assert_eq!(GottaGo::try_from(8999u16), Err(Unrepresentable(8999u16)));

+    assert_eq!(GottaGo::try_from(9000u16), Ok(GottaGo::Fast));

+    assert_eq!(GottaGo::try_from(9001u16), Ok(GottaGo::Faster));

+    assert_eq!(GottaGo::try_from(9002u16), Err(Unrepresentable(9002u16)));

+}

diff --git a/vendor/conv-0.3.3/tests/lang_char.rs b/vendor/conv-0.3.3/tests/lang_char.rs
new file mode 100644
index 0000000..88a9320
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/lang_char.rs
@@ -0,0 +1,121 @@
+extern crate conv;

+

+#[macro_use] mod util;

+

+use conv::*;

+

+use conv::PosOverflow as Of;

+use conv::Unrepresentable as Ur;

+

+macro_rules! check {

+    (@ $from:ty, $to:ty=> $(;)*) => {};

+

+    (@ $from:ty, $to:ty=> try cident; $($tail:tt)*) => {

+        check!(@ $from, $to=> try v: '\x00';);

+        check!(@ $from, $to=> try v: '\x01';);

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> try uident; $($tail:tt)*) => {

+        check!(@ $from, $to=> try v: 0;);

+        check!(@ $from, $to=> try v: 1;);

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> try v: $src:expr, !$dst:expr; $($tail:tt)*) => {

+        {

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.try_into();

+            assert_eq!(dst, Err($dst(src)));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> try v: $src:expr; $($tail:tt)*) => {

+        {

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.try_into();

+            assert_eq!(dst, Ok($src as $to));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qt: *; $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, _> = v.try_into();

+                dst == Ok(v as $to)

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    ($from:ty, $to:ty=> $($tail:tt)*) => {

+        check! { @ $from, $to=> $($tail)*; }

+    };

+}

+

+#[test]

+fn test_i_to_c() {

+    check!(u8, char => try uident; qt: *);

+

+    /*

+    `char` is a pain because `u8` is the *only* type you can cast directly from.  So, the `check!` macro is *basically useless*.

+

+    Also, `char` has a great big hole in the middle, which makes things more interesting.

+

+    Instead, we're just going to make sure that the conversions *exist* and have the expected error type.

+    */

+    macro_rules! check_i_to_c {

+        ($($ts:ty),* $(,)*) => {

+            $(

+                {

+                    let v: $ts = 0;

+                    let r: Result<char, Ur<$ts>> = TryFrom::try_from(v);

+                    assert_eq!(r, Ok('\x00'));

+                }

+            )*

+        };

+    }

+    check_i_to_c!(i8, i16, i32, i64, isize, u16, u32, u64, usize);

+}

+

+#[test]

+fn test_c_to_i() {

+    check!(char, i8=> try cident;

+        try v: '\u{80}', !Of;

+    );

+    check!(char, i16=> try cident;

+        try v: '\u{8000}', !Of;

+    );

+    check!(char, i32=> try cident;);

+    check!(char, i64=> try cident;);

+    check!(char, u8=> try cident;

+        try v: '\u{100}', !Of;

+    );

+    check!(char, u16=> try cident;

+        try v: '\u{10000}', !Of;

+    );

+    check!(char, u32=> try cident;);

+    check!(char, u64=> try cident;);

+    for_bitness! {

+        32 {

+            check!(char, isize=> try cident;

+                try v: '\u{10ffff}';

+            );

+            check!(char, usize=> try cident;);

+        }

+        64 {

+            check!(char, i64=> try cident;);

+            check!(char, u64=> try cident;);

+        }

+    }

+}

diff --git a/vendor/conv-0.3.3/tests/lang_floats.rs b/vendor/conv-0.3.3/tests/lang_floats.rs
new file mode 100644
index 0000000..9ec1a41
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/lang_floats.rs
@@ -0,0 +1,57 @@
+extern crate conv;

+

+#[macro_use] mod util;

+

+use conv::*;

+

+use conv::FloatError::NegOverflow as FU;

+use conv::FloatError::PosOverflow as FO;

+

+#[test]

+fn test_f32() {

+    check!(f32, f32=> fident; qv: *;);

+    check!(f32, f64=> fident; qv: *;);

+}

+

+#[test]

+fn test_f32_to_int() {

+    check!(f32, i8=>  sidenta; qa: i8=>  a: -129.0, !FU; a: 128.0, !FO;);

+    check!(f32, i16=> sidenta; qa: i16=> a: -32_769.0, !FU; a: 32_768.0, !FO;);

+    check!(f32, i32=> sidenta; qa: i32=>

+        a: -2.1474836e9, -2147483648; a: 2.1474835e9, 2147483520;

+        a: -2_147_500_000.0, !FU; a: 2_147_500_000.0, !FO;);

+    check!(f32, i64=> sidenta; qa: i64=>

+        a: -9.223372e18, -9223372036854775808; a: 9.2233715e18, 9223371487098961920;

+        a: -9_223_373_000_000_000_000.0, !FU; a: 9_223_373_000_000_000_000.0, !FO;);

+    check!(f32, u8=>  uidenta; qa: u8=>  a: -1.0, !FU; a: 256.0, !FO;);

+    check!(f32, u16=> uidenta; qa: u16=> a: -1.0, !FU; a: 65_536.0, !FO;);

+    check!(f32, u32=> uidenta; qa: u32=>

+        a: 4.294967e9, 4294967040;

+        a: -1.0, !FU; a: 4_294_968_000.0, !FO;);

+    check!(f32, u64=> uidenta; qa: u64=>

+        a: 1.8446743e19, 18446742974197923840;

+        a: -1.0, !FU; a: 18_446_746_000_000_000_000.0, !FO;);

+}

+

+#[test]

+fn test_f64_to_int() {

+    check!(f64, i8=>  sidenta; qa: i8=>  a: -129.0, !FU; a: 128.0, !FO;);

+    check!(f64, i16=> sidenta; qa: i16=> a: -32_769.0, !FU; a: 32_768.0, !FO;);

+    check!(f64, i32=> sidenta; qa: i32=> a: -2_147_483_649.0, !FU; a: 2_147_483_648.0, !FO;);

+    check!(f64, i64=> sidenta; qa: i64=>

+        a: -9.223372036854776e18, -9223372036854775808;

+        a: 9.223372036854775e18, 9223372036854774784;

+        a: -9_223_372_036_854_778_000.0, !FU; a: 9_223_372_036_854_778_000.0, !FO;);

+    check!(f64, u8=>  uidenta; qa: u8=>  a: -1.0, !FU; a: 256.0, !FO;);

+    check!(f64, u16=> uidenta; qa: u16=> a: -1.0, !FU; a: 65_536.0, !FO;);

+    check!(f64, u32=> uidenta; qa: u32=> a: -1.0, !FU; a: 4_294_967_296.0, !FO;);

+    check!(f64, u64=> uidenta; qa: u64=>

+        a: 1.844674407370955e19;

+        a: -1.0, !FU; a: 18_446_744_073_709_560_000.0, !FO;);

+}

+

+#[test]

+fn test_f64() {

+    check!(f64, f32=> fidenta; qa: *;);

+    check!(f64, f64=> fident; qv: *;);

+}

diff --git a/vendor/conv-0.3.3/tests/lang_ints.rs b/vendor/conv-0.3.3/tests/lang_ints.rs
new file mode 100644
index 0000000..f8f63a7
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/lang_ints.rs
@@ -0,0 +1,395 @@
+extern crate conv;

+

+#[macro_use] mod util;

+

+use conv::*;

+

+use conv::NegOverflow as Uf;

+use conv::PosOverflow as Of;

+use conv::RangeError::NegOverflow as RU;

+use conv::RangeError::PosOverflow as RO;

+

+#[test]

+fn test_i8() {

+    check!(i8, i8=> sident; qv: *; qa: *; qaW: *);

+    check!(i8, i16=> sident; qv: *; qa: *; qaW: *);

+    check!(i8, i32=> sident; qv: *; qa: *; qaW: *);

+    check!(i8, i64=> sident; qv: *; qa: *; qaW: *);

+    check!(i8, u8=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i8, u16=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i8, u32=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i8, u64=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i8, isize=> sident; qv: *; qa: *; qaW: *);

+    check!(i8, usize=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+}

+

+#[test]

+fn test_i16() {

+    check!(i16, i8=> sident; qv: i8=> qa: i8=> qaW: *;

+        v: -129, !RU; v: 128, !RO;

+    );

+    check!(i16, i16=> sident; qv: *; qa: *; qaW: *);

+    check!(i16, i32=> sident; qv: *; qa: *; qaW: *);

+    check!(i16, i64=> sident; qv: *; qa: *; qaW: *);

+    check!(i16, u8=> uident; qv: u8=> qa: +; qaW: *;

+        v: -1, !RU;

+    );

+    check!(i16, u16=> uident; qv: u16, i16=> qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i16, u32=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i16, u64=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i16, isize=> sident; qv: *; qa: *; qaW: *);

+    check!(i16, usize=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+}

+

+#[test]

+fn test_i32() {

+    check!(i32, i8=> sident; qv: i8=> qa: i8=> qaW: *;

+        v: -129, !RU; v: 128, !RO;

+    );

+    check!(i32, i16=> sident; qv: i16=> qa: i16=> qaW: *;

+        v: -32_769, !RU; v: 32_768, !RO;

+    );

+    check!(i32, i32=> sident; qv: *; qa: *; qaW: *);

+    check!(i32, i64=> sident; qv: *; qa: *; qaW: *);

+    check!(i32, u8=> uident; qv: u8=> qa: u8=> qaW: *;

+        v: -1, !RU;

+    );

+    check!(i32, u16=> uident; qv: u16=> qa: u16=> qaW: *;

+        v: -1, !RU;

+    );

+    check!(i32, u32=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    check!(i32, u64=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    for_bitness! {

+        32 {

+            check!(i32, isize=> sident; qv: *; qa: *; qaW: *);

+            check!(i32, usize=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+        }

+        64 {

+            check!(i32, isize=> sident; qv: *; qa: *; qaW: *);

+            check!(i32, usize=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+        }

+    }

+}

+

+#[test]

+fn test_i64() {

+    check!(i64, i8=> sident; qv: i8=> qa: i8=> qaW: *;

+        v: -129, !RU; v: 128, !RO;

+    );

+    check!(i64, i16=> sident; qv: i16=> qa: i16=> qaW: *;

+        v: -32_769, !RU; v: 32_768, !RO;

+    );

+    check!(i64, i32=> sident; qv: i32=> qa: i32=> qaW: *;

+        v: -2_147_483_649, !RU; v: 2_147_483_648, !RO;

+    );

+    check!(i64, i64=> sident; qv: *; qa: *; qaW: *;

+    );

+    check!(i64, u8=> uident; qv: u8=> qa: u8=> qaW: *;

+        v: -1, !RU;

+    );

+    check!(i64, u16=> uident; qv: u16=> qa: u16=> qaW: *;

+        v: -1, !RU;

+    );

+    check!(i64, u32=> uident; qv: u32=> qa: u32=> qaW: *;

+        v: -1, !RU;

+    );

+    check!(i64, u64=> uident; qv: +; qa: +; qaW: *;

+        v: -1, !Uf;

+    );

+    for_bitness! {

+        32 {

+            check!(i64, isize=> sident; qv: isize=> qa: isize=> qaW: *;

+                v: -2_147_483_649, !RU; v: 2_147_483_648, !RO;

+            );

+            check!(i64, usize=> uident; qv: usize=> qa: usize=> qaW: *;

+                v: -1, !RU; v: 4_294_967_296, !RO;

+            );

+        }

+        64 {

+            check!(i64, isize=> sident; qv: *; qa: *; qaW: *;

+            );

+            check!(i64, usize=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+        }

+    }

+}

+

+#[test]

+fn test_u8() {

+    check!(u8, i8=> uident; qv: +i8=> qa: +i8=> qaW: *;

+        v: 127; v: 128, !Of;

+    );

+    check!(u8, i16=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, i32=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, i64=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, u8=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, u16=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, u32=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, u64=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, isize=> uident; qv: *; qa: *; qaW: *);

+    check!(u8, usize=> uident; qv: *; qa: *; qaW: *);

+}

+

+#[test]

+fn test_u16() {

+    check!(u16, i8=> uident; qv: +i8=> qa: +i8=> qaW: *;

+        v: 128, !Of;

+    );

+    check!(u16, i16=> uident; qv: +i16=> qa: +i16=> qaW: *;

+        v: 32_768, !Of;

+    );

+    check!(u16, i32=> uident; qv: *; qa: *; qaW: *);

+    check!(u16, i64=> uident; qv: *; qa: *; qaW: *);

+    check!(u16, u8=> uident; qv: u8=> qa: u8=> qaW: *;

+        v: 256, !Of;

+    );

+    check!(u16, u16=> uident; qv: *; qa: *; qaW: *);

+    check!(u16, u32=> uident; qv: *; qa: *; qaW: *);

+    check!(u16, u64=> uident; qv: *; qa: *; qaW: *);

+    check!(u16, isize=> uident; qv: *; qa: *; qaW: *);

+    check!(u16, usize=> uident; qv: *; qa: *; qaW: *);

+}

+

+#[test]

+fn test_u32() {

+    check!(u32, i8=> uident; qv: +i8=> qa: +i8=> qaW: *;

+        v: 128, !Of;

+    );

+    check!(u32, i16=> uident; qv: +i16=> qa: +i16=> qaW: *;

+        v: 32_768, !Of;

+    );

+    check!(u32, i32=> uident; qv: +i32=> qa: +i32=> qaW: *;

+        v: 2_147_483_648, !Of;

+    );

+    check!(u32, i64=> uident; qv: *; qa: *; qaW: *);

+    check!(u32, u8=> uident; qv: u8=> qa: u8=> qaW: *;

+        v: 256, !Of;

+    );

+    check!(u32, u16=> uident; qv: u16=> qa: u16=> qaW: *;

+        v: 65_536, !Of;

+    );

+    check!(u32, u32=> uident; qv: *; qa: *; qaW: *);

+    check!(u32, u64=> uident; qv: *; qa: *; qaW: *);

+    for_bitness! {

+        32 {

+            check!(u32, isize=> uident; qv: +isize=> qa: +isize=> qaW: *;

+                v: 2_147_483_647; v: 2_147_483_648, !Of;

+            );

+            check!(u32, usize=> uident; qv: *; qa: *; qaW: *);

+        }

+        64 {

+            check!(u32, isize=> uident; qv: *; qa: *; qaW: *);

+            check!(u32, usize=> uident; qv: *; qa: *; qaW: *);

+        }

+    }

+}

+

+#[test]

+fn test_u64() {

+    check!(u64, i8=> uident; qv: +i8=> qa: +i8=> qaW: *;

+        v: 128, !Of;

+    );

+    check!(u64, i16=> uident; qv: +i16=> qa: +i16=> qaW: *;

+        v: 32_768, !Of;

+    );

+    check!(u64, i32=> uident; qv: +i32=> qa: +i32=> qaW: *;

+        v: 2_147_483_648, !Of;

+    );

+    check!(u64, i64=> uident; qv: +i64=> qa: +i64=> qaW: *;

+        v: 9_223_372_036_854_775_808, !Of;

+    );

+    check!(u64, u8=> uident; qv: u8=> qa: u8=> qaW: *;

+        v: 256, !Of;

+    );

+    check!(u64, u16=> uident; qv: u16=> qa: u16=> qaW: *;

+        v: 65_536, !Of;

+    );

+    check!(u64, u32=> uident; qv: u32=> qa: u32=> qaW: *;

+        v: 4_294_967_296, !Of;

+    );

+    check!(u64, u64=> uident; qv: *; qa: *; qaW: *);

+    for_bitness! {

+        32 {

+            check!(u64, isize=> uident; qv: +isize=> qa: +isize=> qaW: *;

+                v: 2_147_483_648, !Of;

+            );

+            check!(u64, usize=> uident; qv: usize=> qa: usize=> qaW: *;

+                v: 4_294_967_296, !Of;

+            );

+        }

+        64 {

+            check!(u64, isize=> uident; qv: +i64=> qa: +i64=> qaW: *;

+                v: 9_223_372_036_854_775_808, !Of;

+            );

+            check!(u64, usize=> uident; qv: *; qa: *; qaW: *);

+        }

+    }

+}

+

+#[test]

+fn test_isize() {

+    check!(isize, i8=> sident; qv: i8=> qa: i8=> qaW: *;

+        v: -129, !RU; v: 128, !RO;

+    );

+    check!(isize, i16=> sident; qv: i16=> qa: i16=> qaW: *;

+        v: -32_769, !RU; v: 32_768, !RO;

+    );

+    check!(isize, u8=> uident; qv: u8=> qa: u8=> qaW: *;

+        v: -1, !RU; v: 256, !RO;

+    );

+    check!(isize, u16=> uident; qv: u16=> qa: u16=> qaW: *;

+        v: -1, !RU; v: 65_536, !RO;

+    );

+    check!(isize, isize=> sident; qv: *; qa: *; qaW: *);

+    for_bitness! {

+        32 {

+            check!(isize, i32=> sident; qv: *; qa: *; qaW: *);

+            check!(isize, i64=> sident; qv: *; qa: *; qaW: *);

+            check!(isize, u32=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+            check!(isize, u64=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+            check!(isize, usize=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+        }

+        64 {

+            check!(isize, i32=> sident; qv: *; qa: *; qaW: *);

+            check!(isize, i64=> sident; qv: *; qa: *; qaW: *);

+            check!(isize, u32=> uident; qv: u32=> qa: u32=> qaW: *;

+                v: -1, !RU; v: 4_294_967_296, !RO;

+            );

+            check!(isize, u64=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+            check!(isize, usize=> uident; qv: +; qa: +; qaW: *;

+                v: -1, !Uf;

+            );

+        }

+    }

+}

+

+#[test]

+fn test_usize() {

+    check!(usize, i8=> uident; qv: +i8=> qa: +i8=> qaW: *;

+        v: 128, !Of;

+    );

+    check!(usize, i16=> uident; qv: +i16=> qa: +i16=> qaW: *;

+        v: 32_768, !Of;

+    );

+    check!(usize, u8=> uident; qv: u8=> qa: u8=> qaW: *;

+        v: 256, !Of;

+    );

+    check!(usize, u16=> uident; qv: u16=> qa: u16=> qaW: *;

+        v: 65_536, !Of;

+    );

+    check!(usize, usize=> uident; qv: *; qa: *; qaW: *);

+    for_bitness! {

+        32 {

+            check!(usize, i32=> uident; qv: +i32=> qa: +i32=> qaW: *);

+            check!(usize, i64=> uident; qv: *; qa: *; qaW: *);

+            check!(usize, u32=> uident; qv: *; qa: *; qaW: *);

+            check!(usize, u64=> uident; qv: *; qa: *; qaW: *);

+            check!(usize, isize=> uident; qv: +isize=> qa: +isize=> qaW: *);

+        }

+        64 {

+            check!(usize, i32=> uident; qv: +i32=> qa: +i32=> qaW: *);

+            check!(usize, i64=> uident; qv: +i64=> qa: +i64=> qaW: *);

+            check!(usize, u32=> uident; qv: u32=> qa: u32=> qaW: *;

+                v: 4_294_967_296, !Of;

+            );

+            check!(usize, u64=> uident; qv: *; qa: *; qaW: *);

+            check!(usize, isize=> uident; qv: +isize=> qa: +isize=> qaW: *);

+        }

+    }

+}

+

+#[test]

+fn test_i_to_f() {

+    check!(i8,  f32=> sident; qv: *; qa: *);

+    check!(i16, f32=> sident; qv: *; qa: *);

+    check!(i32, f32=> sident; qv: (+-16_777_216); qa: *;

+        v: -16_777_217, !RU; v: 16_777_217, !RO;

+    );

+    check!(i64, f32=> sident; qv: (+-16_777_216); qa: *;

+        v: -16_777_217, !RU; v: 16_777_217, !RO;

+    );

+    check!(isize, f32=> sident; qv: (+-16_777_216); qa: *;

+        v: -16_777_217, !RU; v: 16_777_217, !RO;

+    );

+

+    check!(u8,  f32=> uident; qv: *; qa: *);

+    check!(u16, f32=> uident; qv: *; qa: *);

+    check!(u32, f32=> uident; qv: (, 16_777_216); qa: *;

+        v: 16_777_217, !Of;

+    );

+    check!(u64, f32=> uident; qv: (, 16_777_216); qa: *;

+        v: 16_777_217, !Of;

+    );

+    check!(usize, f32=> uident; qv: (, 16_777_216); qa: *;

+        v: 16_777_217, !Of;

+    );

+

+    check!(i8,  f64=> sident; qv: *; qa: *);

+    check!(i16, f64=> sident; qv: *; qa: *);

+    check!(i32, f64=> sident; qv: *; qa: *);

+    check!(i64, f64=> sident; qv: (+-9_007_199_254_740_992); qa: *;

+        v: -9_007_199_254_740_993, !RU; v: 9_007_199_254_740_993, !RO;

+    );

+    for_bitness! {

+        32 {

+            check!(isize, f64=> sident; qv: *; qa: *);

+        }

+        64 {

+            check!(i64, f64=> sident; qv: (+-9_007_199_254_740_992); qa: *;

+                v: -9_007_199_254_740_993, !RU; v: 9_007_199_254_740_993, !RO;

+            );

+        }

+    }

+

+    check!(u8,  f64=> uident; qv: *; qa: *);

+    check!(u16, f64=> uident; qv: *; qa: *);

+    check!(u32, f64=> uident; qv: *; qa: *);

+    check!(u64, f64=> uident; qv: (, 9_007_199_254_740_992); qa: *;

+        v: 9_007_199_254_740_993, !Of;

+    );

+    for_bitness! {

+        32 {

+            check!(usize, f64=> uident; qv: *; qa: *);

+        }

+        64 {

+            check!(u64, f64=> uident; qv: (, 9_007_199_254_740_992); qa: *;

+                v: 9_007_199_254_740_993, !Of;

+            );

+        }

+    }

+}

diff --git a/vendor/conv-0.3.3/tests/unwraps.rs b/vendor/conv-0.3.3/tests/unwraps.rs
new file mode 100644
index 0000000..921dec7
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/unwraps.rs
@@ -0,0 +1,31 @@
+extern crate conv;

+

+#[macro_use] mod util;

+

+use conv::*;

+

+macro_rules! cty {

+    ($e:expr, $t:ty) => {

+        { let v: $t = $e; v }

+    };

+}

+

+#[test]

+fn test_unwraps() {

+    assert_eq!(cty!(0i16.value_into().unwrap(), i32), 0);

+    assert_eq!(cty!(127i16.value_into().unwrap(), i8), 127);

+    assert_eq!(cty!(128i16.value_into().unwrap_or_saturate(), i8), 127);

+    assert_eq!(cty!(128i16.approx().unwrap_or_saturate(), i8), 127);

+    assert_eq!(cty!(128i16.approx_by::<Wrapping>().unwrap_or_saturate(), i8), -128);

+

+    assert_eq!(cty!(16_777_216i32.value_into().unwrap(), f32), 16_777_216.0);

+    assert_eq!(cty!(16_777_216i32.value_into().unwrap_or_inf(), f32), 16_777_216.0);

+    assert_eq!(cty!(16_777_217i32.value_into().unwrap_or_inf(), f32), std::f32::INFINITY);

+    assert_eq!(cty!((-16_777_217i32).value_into().unwrap_or_inf(), f32), std::f32::NEG_INFINITY);

+

+    assert_eq!(cty!(16_777_216i32.value_into().unwrap_or_invalid(), f32), 16_777_216.0);

+    assert!(cty!(16_777_217i32.value_into().unwrap_or_invalid(), f32).is_nan());

+    assert!(cty!((-16_777_217i32).value_into().unwrap_or_invalid(), f32).is_nan());

+

+    assert_eq!(cty!(0u8.value_into().unwrap_ok(), u16), 0);

+}

diff --git a/vendor/conv-0.3.3/tests/use_in_generics.rs b/vendor/conv-0.3.3/tests/use_in_generics.rs
new file mode 100644
index 0000000..9400dac
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/use_in_generics.rs
@@ -0,0 +1,14 @@
+//! Are conversions easily usable in generic code?

+extern crate conv;

+

+use conv::prelude::*;

+

+#[test]

+fn test_generic_unwrap() {

+    fn do_conv<T, U>(t: T) -> U

+    where T: ValueInto<U> {

+        t.value_into().unwrap()

+    }

+

+    assert_eq!({let x: u8 = do_conv(42i32); x}, 42u8);

+}

diff --git a/vendor/conv-0.3.3/tests/util/mod.rs b/vendor/conv-0.3.3/tests/util/mod.rs
new file mode 100644
index 0000000..9bb5abf
--- /dev/null
+++ b/vendor/conv-0.3.3/tests/util/mod.rs
@@ -0,0 +1,509 @@
+macro_rules! SL {

+    ($($tts:tt)*) => { stringify!($($tts)*) };

+}

+

+macro_rules! as_expr {

+    ($e:expr) => {$e};

+}

+

+macro_rules! check {

+    (@ $from:ty, $to:ty=> $(;)*) => {};

+

+    (@ $from:ty, $to:ty=> cident; $($tail:tt)*) => {

+        check!(@ $from, $to=> v: '\x00';);

+        check!(@ $from, $to=> v: '\x01';);

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> uident; $($tail:tt)*) => {

+        check!(@ $from, $to=> v: 0;);

+        check!(@ $from, $to=> v: 1;);

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> sident; $($tail:tt)*) => {

+        check!(@ $from, $to=> v: -1;);

+        check!(@ $from, $to=> v: 0;);

+        check!(@ $from, $to=> v: 1;);

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> fident; $($tail:tt)*) => {

+        check!(@ $from, $to=> v: -1.0;);

+        check!(@ $from, $to=> v:  0.0;);

+        check!(@ $from, $to=> v:  1.0;);

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> uidenta; $($tail:tt)*) => {

+        check!(@ $from, $to=> a: 0.0;);

+        check!(@ $from, $to=> a: 1.0;);

+

+        check!(@ $from, $to=> aRTN: 0.00, 0;);

+        check!(@ $from, $to=> aRTN: 0.25, 0;);

+        check!(@ $from, $to=> aRTN: 0.50, 1;);

+        check!(@ $from, $to=> aRTN: 0.75, 1;);

+        check!(@ $from, $to=> aRTN: 1.00, 1;);

+

+        check!(@ $from, $to=> aRNI:  0.00,  0;);

+        check!(@ $from, $to=> aRNI:  0.25,  0;);

+        check!(@ $from, $to=> aRNI:  0.50,  0;);

+        check!(@ $from, $to=> aRNI:  0.75,  0;);

+        check!(@ $from, $to=> aRNI:  1.00,  1;);

+

+        check!(@ $from, $to=> aRPI:  0.00,  0;);

+        check!(@ $from, $to=> aRPI:  0.25,  1;);

+        check!(@ $from, $to=> aRPI:  0.50,  1;);

+        check!(@ $from, $to=> aRPI:  0.75,  1;);

+        check!(@ $from, $to=> aRPI:  1.00,  1;);

+

+        check!(@ $from, $to=> aRTZ:  0.00,  0;);

+        check!(@ $from, $to=> aRTZ:  0.25,  0;);

+        check!(@ $from, $to=> aRTZ:  0.50,  0;);

+        check!(@ $from, $to=> aRTZ:  0.75,  0;);

+        check!(@ $from, $to=> aRTZ:  1.00,  1;);

+

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> sidenta; $($tail:tt)*) => {

+        check!(@ $from, $to=> a: -1.0;);

+        check!(@ $from, $to=> a:  0.0;);

+        check!(@ $from, $to=> a:  1.0;);

+

+        check!(@ $from, $to=> aRTN: -1.00, -1;);

+        check!(@ $from, $to=> aRTN: -0.75, -1;);

+        check!(@ $from, $to=> aRTN: -0.50, -1;);

+        check!(@ $from, $to=> aRTN: -0.25,  0;);

+        check!(@ $from, $to=> aRTN:  0.00,  0;);

+        check!(@ $from, $to=> aRTN:  0.25,  0;);

+        check!(@ $from, $to=> aRTN:  0.50,  1;);

+        check!(@ $from, $to=> aRTN:  0.75,  1;);

+        check!(@ $from, $to=> aRTN:  1.00,  1;);

+

+        check!(@ $from, $to=> aRNI: -1.00, -1;);

+        check!(@ $from, $to=> aRNI: -0.75, -1;);

+        check!(@ $from, $to=> aRNI: -0.50, -1;);

+        check!(@ $from, $to=> aRNI: -0.25, -1;);

+        check!(@ $from, $to=> aRNI:  0.00,  0;);

+        check!(@ $from, $to=> aRNI:  0.25,  0;);

+        check!(@ $from, $to=> aRNI:  0.50,  0;);

+        check!(@ $from, $to=> aRNI:  0.75,  0;);

+        check!(@ $from, $to=> aRNI:  1.00,  1;);

+

+        check!(@ $from, $to=> aRPI: -1.00, -1;);

+        check!(@ $from, $to=> aRPI: -0.75,  0;);

+        check!(@ $from, $to=> aRPI: -0.50,  0;);

+        check!(@ $from, $to=> aRPI: -0.25,  0;);

+        check!(@ $from, $to=> aRPI:  0.00,  0;);

+        check!(@ $from, $to=> aRPI:  0.25,  1;);

+        check!(@ $from, $to=> aRPI:  0.50,  1;);

+        check!(@ $from, $to=> aRPI:  0.75,  1;);

+        check!(@ $from, $to=> aRPI:  1.00,  1;);

+

+        check!(@ $from, $to=> aRTZ: -1.00, -1;);

+        check!(@ $from, $to=> aRTZ: -0.75,  0;);

+        check!(@ $from, $to=> aRTZ: -0.50,  0;);

+        check!(@ $from, $to=> aRTZ: -0.25,  0;);

+        check!(@ $from, $to=> aRTZ:  0.00,  0;);

+        check!(@ $from, $to=> aRTZ:  0.25,  0;);

+        check!(@ $from, $to=> aRTZ:  0.50,  0;);

+        check!(@ $from, $to=> aRTZ:  0.75,  0;);

+        check!(@ $from, $to=> aRTZ:  1.00,  1;);

+

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> fidenta; $($tail:tt)*) => {

+        check!(@ $from, $to=> a: -1.0;);

+        check!(@ $from, $to=> a:  0.0;);

+        check!(@ $from, $to=> a:  1.0;);

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> v: $src:expr, !$dst:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, v: {}, !{}", SL!($from), SL!($to), SL!($src), SL!($dst));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.value_into();

+            assert_eq!(dst, Err($dst(src)));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> v: $src:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, v: {}", SL!($from), SL!($to), SL!($src));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.value_into();

+            assert_eq!(dst, Ok($src as $to));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qv: *; $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qv: *", SL!($from), SL!($to));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, _> = v.value_into();

+                dst == Ok(v as $to)

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qv: (+-$bound:expr); $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qv: (+- {})", SL!($from), SL!($to), SL!($bound));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from);

+                if !(-$bound as $from <= v) {

+                    dst == Err(conv::FloatError::NegOverflow(v))

+                } else if !(v <= $bound as $from) {

+                    dst == Err(conv::FloatError::PosOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qv: (, $bound:expr); $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qv: (, {})", SL!($from), SL!($to), SL!($bound));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from);

+                if !(v <= $bound as $from) {

+                    dst == Err(conv::FloatError::PosOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qv: +; $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qv: +", SL!($from), SL!($to));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from);

+                if !(0 <= v) {

+                    dst == Err(conv::FloatError::NegOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qv: +$max:ty=> $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qv: +{}", SL!($from), SL!($to), SL!($max));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from);

+                if !(v <= <$max>::max_value() as $from) {

+                    dst == Err(conv::FloatError::PosOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qv: $bound:ty=> $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qv: {}", SL!($from), SL!($to), SL!($bound));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from);

+                if !(<$bound>::min_value() as $from <= v) {

+                    dst == Err(conv::FloatError::NegOverflow(v))

+                } else if !(v <= <$bound>::max_value() as $from) {

+                    dst == Err(conv::FloatError::PosOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qv: $min:ty, $max:ty=> $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qv: {}, {}", SL!($from), SL!($to), SL!($min), SL!($max));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.value_into().map_err(From::from);

+                if !(<$min>::min_value() as $from <= v) {

+                    dst == Err(conv::FloatError::NegOverflow(v))

+                } else if !(v <= <$max>::max_value() as $from) {

+                    dst == Err(conv::FloatError::PosOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qv {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> a: $src:expr, !$dst:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, a: {}, !{}", SL!($from), SL!($to), SL!($src), SL!($dst));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.approx_as();

+            assert_eq!(dst, Err($dst(src)));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> a: $src:expr, $dst:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, a: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.approx_as();

+            assert_eq!(dst, Ok($dst));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> a: $src:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, a: {}", SL!($from), SL!($to), SL!($src));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.approx_as();

+            assert_eq!(dst, Ok($src as $to));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qa: *; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, qa: *", SL!($from), SL!($to));

+            extern crate quickcheck;

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, _> = v.approx_as();

+                dst == Ok(v as $to)

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qa {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qa: +; $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qa: +", SL!($from), SL!($to));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.approx_as().map_err(From::from);

+                if !(0 <= v) {

+                    dst == Err(conv::FloatError::NegOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qa {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qa: +$max:ty=> $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qa: +{}", SL!($from), SL!($to), SL!($max));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.approx_as().map_err(From::from);

+                if !(v <= <$max>::max_value() as $from) {

+                    dst == Err(conv::FloatError::PosOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qa {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qa: $bound:ty=> $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qa: {}", SL!($from), SL!($to), SL!($bound));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, conv::FloatError<_>> = v.approx_as().map_err(From::from);

+                if !(<$bound>::min_value() as $from <= v) {

+                    dst == Err(conv::FloatError::NegOverflow(v))

+                } else if !(v <= <$bound>::max_value() as $from) {

+                    dst == Err(conv::FloatError::PosOverflow(v))

+                } else {

+                    dst == Ok(v as $to)

+                }

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qa {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> qaW: *; $($tail:tt)*) => {

+        {

+            extern crate quickcheck;

+            println!("? {} => {}, qaW: *", SL!($from), SL!($to));

+

+            fn property(v: $from) -> bool {

+                let dst: Result<$to, _> = v.approx_as_by::<_, Wrapping>();

+                dst == Ok(v as $to)

+            }

+

+            let mut qc = quickcheck::QuickCheck::new();

+            match qc.quicktest(property as fn($from) -> bool) {

+                Ok(_) => (),

+                Err(err) => panic!("qaW {:?}", err)

+            }

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> aRTN: $src:expr, $dst:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, aRTN: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.approx_by::<conv::RoundToNearest>();

+            assert_eq!(dst, Ok($dst));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> aRNI: $src:expr, $dst:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, aRNI: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.approx_by::<conv::RoundToNegInf>();

+            assert_eq!(dst, Ok($dst));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> aRPI: $src:expr, $dst:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, aRPI: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.approx_by::<conv::RoundToPosInf>();

+            assert_eq!(dst, Ok($dst));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    (@ $from:ty, $to:ty=> aRTZ: $src:expr, $dst:expr; $($tail:tt)*) => {

+        {

+            println!("? {} => {}, aRTZ: {}, {}", SL!($from), SL!($to), SL!($src), SL!($dst));

+            let src: $from = $src;

+            let dst: Result<$to, _> = src.approx_by::<conv::RoundToZero>();

+            assert_eq!(dst, Ok($dst));

+        }

+        check!(@ $from, $to=> $($tail)*);

+    };

+

+    ($from:ty, $to:ty=> $($tail:tt)*) => {

+        check! { @ $from, $to=> $($tail)*; }

+    };

+}

+

+macro_rules! for_bitness {

+    (32 {$($bits32:tt)*} 64 {$($bits64:tt)*}) => {

+        as_expr!(

+            {

+                #[cfg(target_pointer_width="32")]

+                fn for_bitness() {

+                    $($bits32)*

+                }

+

+                #[cfg(target_pointer_width="64")]

+                fn for_bitness() {

+                    $($bits64)*

+                }

+

+                for_bitness()

+            }

+        )

+    };

+}

diff --git a/vendor/custom_derive-0.1.7/.cargo-checksum.json b/vendor/custom_derive-0.1.7/.cargo-checksum.json
new file mode 100644
index 0000000..b6cd96c
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"c8d9fbb153e05449a9f675e0a10c6a991dc41b3ba6f3f2ce0d966820c69628b6","Cargo.toml":"da4c9f7564b52be1d09c3b8f21add3a758be4414a3ce87236fb703b6a56c2aa6","LICENSE":"9f95cbf09c33a40ca7e540d5adb58e8da482392af761d4785e43f0f8c3f62332","README.md":"dccbb045569494d7ab7b99c0a19eaa55d3b41672d413ae28ccd22385ef373176","src/lib.rs":"083607fa43010439264b15573100b948cf6f1bb47e5ee177d4e170b73e0b4ed4","tests/empty_bi_derives.rs":"e62f18552e20aad7f179e7dc05557d1bcf7b20e804d76f99adf1f3b243f5ded8","tests/enum_iterator.rs":"9d75cd2232bd1b89ea3057a6f1f5892bd1f47e69a76d8595c603e530a633de6b","tests/enum_try_from.rs":"40a6ca8ca16aa41e43c7ba46b62feee558b6c8ac495f6b69ae9912f7c3a68b07","tests/passthru_derive.rs":"0a41acc21c3e65e34f0cce152e9b88d5ff6e0dd6f1b9680841b93f2e8a09bf59","tests/stable_encodable.rs":"441f2c11aa60b9c6e7647f907f1134155a76cbbfa7f98d404a8be759ab0b2044","tests/trailing_comma.rs":"4b3f96014f261824cfb8e86d4ee37e721e55e25b141556df03ee16840f7fd89c"},"package":"ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"}
\ No newline at end of file
diff --git a/vendor/custom_derive-0.1.7/.cargo-ok b/vendor/custom_derive-0.1.7/.cargo-ok
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/.cargo-ok
diff --git a/vendor/custom_derive-0.1.7/.gitignore b/vendor/custom_derive-0.1.7/.gitignore
new file mode 100644
index 0000000..b6cc356
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/.gitignore
@@ -0,0 +1,4 @@
+/.local

+/local

+target

+Cargo.lock

diff --git a/vendor/custom_derive-0.1.7/Cargo.toml b/vendor/custom_derive-0.1.7/Cargo.toml
new file mode 100644
index 0000000..610fdd9
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/Cargo.toml
@@ -0,0 +1,33 @@
+[package]

+name = "custom_derive"

+version = "0.1.7"

+authors = ["Daniel Keep <daniel.keep@gmail.com>"]

+

+description = "(Note: superseded by `macro-attr`) This crate provides a macro that enables the use of custom derive attributes."

+repository = "https://github.com/DanielKeep/rust-custom-derive/tree/custom_derive-master"

+documentation = "https://docs.rs/crate/custom_derive/"

+license = "MIT/Apache-2.0"

+keywords = ["custom", "derive", "macro"]

+

+exclude = [

+    ".cargo/*",

+    "local/*",

+    "doc-pkg/*",

+    "scripts/*",

+    ".gitmodules",

+    ".travis.yml",

+    "update-docs.py",

+]

+

+[workspace]

+members = [

+    "enum_derive",

+    "newtype_derive",

+]

+

+[features]

+default = ["std"]

+std = []

+

+[dev-dependencies]

+rustc-serialize = "0.3.15"

diff --git a/vendor/custom_derive-0.1.7/LICENSE b/vendor/custom_derive-0.1.7/LICENSE
new file mode 100644
index 0000000..6843892
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/LICENSE
@@ -0,0 +1,237 @@
+Copyright ⓒ 2015, 2016 rust-custom-derive contributors.

+

+Licensed under either of:

+

+* MIT license, or

+* Apache License, Version 2.0

+

+at your option.

+

+Unless you explicitly state otherwise, any contribution intentionally

+submitted for inclusion in the work by you shall be dual licensed as

+above, without any additional terms or conditions.

+

+# MIT License

+

+Permission is hereby granted, free of charge, to any person obtaining

+a copy of this software and associated documentation files (the

+"Software"), to deal in the Software without restriction, including

+without limitation the rights to use, copy, modify, merge, publish,

+distribute, sublicense, and/or sell copies of the Software, and to

+permit persons to whom the Software is furnished to do so, subject

+to the following conditions:

+

+The above copyright notice and this permission notice shall be included

+in all copies or substantial portions of the Software.

+

+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS

+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR

+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,

+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

+OTHER DEALINGS IN THE SOFTWARE.

+

+# Apache License, Version 2.0

+

+                              Apache License

+                        Version 2.0, January 2004

+                     http://www.apache.org/licenses/

+

+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

+

+1. Definitions.

+

+   "License" shall mean the terms and conditions for use, reproduction,

+   and distribution as defined by Sections 1 through 9 of this document.

+

+   "Licensor" shall mean the copyright owner or entity authorized by

+   the copyright owner that is granting the License.

+

+   "Legal Entity" shall mean the union of the acting entity and all

+   other entities that control, are controlled by, or are under common

+   control with that entity. For the purposes of this definition,

+   "control" means (i) the power, direct or indirect, to cause the

+   direction or management of such entity, whether by contract or

+   otherwise, or (ii) ownership of fifty percent (50%) or more of the

+   outstanding shares, or (iii) beneficial ownership of such entity.

+

+   "You" (or "Your") shall mean an individual or Legal Entity

+   exercising permissions granted by this License.

+

+   "Source" form shall mean the preferred form for making modifications,

+   including but not limited to software source code, documentation

+   source, and configuration files.

+

+   "Object" form shall mean any form resulting from mechanical

+   transformation or translation of a Source form, including but

+   not limited to compiled object code, generated documentation,

+   and conversions to other media types.

+

+   "Work" shall mean the work of authorship, whether in Source or

+   Object form, made available under the License, as indicated by a

+   copyright notice that is included in or attached to the work

+   (an example is provided in the Appendix below).

+

+   "Derivative Works" shall mean any work, whether in Source or Object

+   form, that is based on (or derived from) the Work and for which the

+   editorial revisions, annotations, elaborations, or other modifications

+   represent, as a whole, an original work of authorship. For the purposes

+   of this License, Derivative Works shall not include works that remain

+   separable from, or merely link (or bind by name) to the interfaces of,

+   the Work and Derivative Works thereof.

+

+   "Contribution" shall mean any work of authorship, including

+   the original version of the Work and any modifications or additions

+   to that Work or Derivative Works thereof, that is intentionally

+   submitted to Licensor for inclusion in the Work by the copyright owner

+   or by an individual or Legal Entity authorized to submit on behalf of

+   the copyright owner. For the purposes of this definition, "submitted"

+   means any form of electronic, verbal, or written communication sent

+   to the Licensor or its representatives, including but not limited to

+   communication on electronic mailing lists, source code control systems,

+   and issue tracking systems that are managed by, or on behalf of, the

+   Licensor for the purpose of discussing and improving the Work, but

+   excluding communication that is conspicuously marked or otherwise

+   designated in writing by the copyright owner as "Not a Contribution."

+

+   "Contributor" shall mean Licensor and any individual or Legal Entity

+   on behalf of whom a Contribution has been received by Licensor and

+   subsequently incorporated within the Work.

+

+2. Grant of Copyright License. Subject to the terms and conditions of

+   this License, each Contributor hereby grants to You a perpetual,

+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable

+   copyright license to reproduce, prepare Derivative Works of,

+   publicly display, publicly perform, sublicense, and distribute the

+   Work and such Derivative Works in Source or Object form.

+

+3. Grant of Patent License. Subject to the terms and conditions of

+   this License, each Contributor hereby grants to You a perpetual,

+   worldwide, non-exclusive, no-charge, royalty-free, irrevocable

+   (except as stated in this section) patent license to make, have made,

+   use, offer to sell, sell, import, and otherwise transfer the Work,

+   where such license applies only to those patent claims licensable

+   by such Contributor that are necessarily infringed by their

+   Contribution(s) alone or by combination of their Contribution(s)

+   with the Work to which such Contribution(s) was submitted. If You

+   institute patent litigation against any entity (including a

+   cross-claim or counterclaim in a lawsuit) alleging that the Work

+   or a Contribution incorporated within the Work constitutes direct

+   or contributory patent infringement, then any patent licenses

+   granted to You under this License for that Work shall terminate

+   as of the date such litigation is filed.

+

+4. Redistribution. You may reproduce and distribute copies of the

+   Work or Derivative Works thereof in any medium, with or without

+   modifications, and in Source or Object form, provided that You

+   meet the following conditions:

+

+   (a) You must give any other recipients of the Work or

+       Derivative Works a copy of this License; and

+

+   (b) You must cause any modified files to carry prominent notices

+       stating that You changed the files; and

+

+   (c) You must retain, in the Source form of any Derivative Works

+       that You distribute, all copyright, patent, trademark, and

+       attribution notices from the Source form of the Work,

+       excluding those notices that do not pertain to any part of

+       the Derivative Works; and

+

+   (d) If the Work includes a "NOTICE" text file as part of its

+       distribution, then any Derivative Works that You distribute must

+       include a readable copy of the attribution notices contained

+       within such NOTICE file, excluding those notices that do not

+       pertain to any part of the Derivative Works, in at least one

+       of the following places: within a NOTICE text file distributed

+       as part of the Derivative Works; within the Source form or

+       documentation, if provided along with the Derivative Works; or,

+       within a display generated by the Derivative Works, if and

+       wherever such third-party notices normally appear. The contents

+       of the NOTICE file are for informational purposes only and

+       do not modify the License. You may add Your own attribution

+       notices within Derivative Works that You distribute, alongside

+       or as an addendum to the NOTICE text from the Work, provided

+       that such additional attribution notices cannot be construed

+       as modifying the License.

+

+   You may add Your own copyright statement to Your modifications and

+   may provide additional or different license terms and conditions

+   for use, reproduction, or distribution of Your modifications, or

+   for any such Derivative Works as a whole, provided Your use,

+   reproduction, and distribution of the Work otherwise complies with

+   the conditions stated in this License.

+

+5. Submission of Contributions. Unless You explicitly state otherwise,

+   any Contribution intentionally submitted for inclusion in the Work

+   by You to the Licensor shall be under the terms and conditions of

+   this License, without any additional terms or conditions.

+   Notwithstanding the above, nothing herein shall supersede or modify

+   the terms of any separate license agreement you may have executed

+   with Licensor regarding such Contributions.

+

+6. Trademarks. This License does not grant permission to use the trade

+   names, trademarks, service marks, or product names of the Licensor,

+   except as required for reasonable and customary use in describing the

+   origin of the Work and reproducing the content of the NOTICE file.

+

+7. Disclaimer of Warranty. Unless required by applicable law or

+   agreed to in writing, Licensor provides the Work (and each

+   Contributor provides its Contributions) on an "AS IS" BASIS,

+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or

+   implied, including, without limitation, any warranties or conditions

+   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A

+   PARTICULAR PURPOSE. You are solely responsible for determining the

+   appropriateness of using or redistributing the Work and assume any

+   risks associated with Your exercise of permissions under this License.

+

+8. Limitation of Liability. In no event and under no legal theory,

+   whether in tort (including negligence), contract, or otherwise,

+   unless required by applicable law (such as deliberate and grossly

+   negligent acts) or agreed to in writing, shall any Contributor be

+   liable to You for damages, including any direct, indirect, special,

+   incidental, or consequential damages of any character arising as a

+   result of this License or out of the use or inability to use the

+   Work (including but not limited to damages for loss of goodwill,

+   work stoppage, computer failure or malfunction, or any and all

+   other commercial damages or losses), even if such Contributor

+   has been advised of the possibility of such damages.

+

+9. Accepting Warranty or Additional Liability. While redistributing

+   the Work or Derivative Works thereof, You may choose to offer,

+   and charge a fee for, acceptance of support, warranty, indemnity,

+   or other liability obligations and/or rights consistent with this

+   License. However, in accepting such obligations, You may act only

+   on Your own behalf and on Your sole responsibility, not on behalf

+   of any other Contributor, and only if You agree to indemnify,

+   defend, and hold each Contributor harmless for any liability

+   incurred by, or claims asserted against, such Contributor by reason

+   of your accepting any such warranty or additional liability.

+

+END OF TERMS AND CONDITIONS

+

+APPENDIX: How to apply the Apache License to your work.

+

+   To apply the Apache License to your work, attach the following

+   boilerplate notice, with the fields enclosed by brackets "[]"

+   replaced with your own identifying information. (Don't include

+   the brackets!)  The text should be enclosed in the appropriate

+   comment syntax for the file format. We also recommend that a

+   file or class name and description of purpose be included on the

+   same "printed page" as the copyright notice for easier

+   identification within third-party archives.

+

+Copyright [yyyy] [name of copyright owner]

+

+Licensed under the Apache License, Version 2.0 (the "License");

+you may not use this file except in compliance with the License.

+You may obtain a copy of the License at

+

+    http://www.apache.org/licenses/LICENSE-2.0

+

+Unless required by applicable law or agreed to in writing, software

+distributed under the License is distributed on an "AS IS" BASIS,

+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+See the License for the specific language governing permissions and

+limitations under the License.

diff --git a/vendor/custom_derive-0.1.7/README.md b/vendor/custom_derive-0.1.7/README.md
new file mode 100644
index 0000000..203a2be
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/README.md
@@ -0,0 +1,24 @@
+# `custom_derive!`

+

+**Note**: This crate has been superseded by `macro-attr`.

+

+This crate provides a macro that enables the use of custom `derive` attributes.

+

+**Links**

+

+* [Latest Release](https://crates.io/crates/custom_derive/)

+* [Latest Docs](https://docs.rs/crate/custom_derive/)

+* [Repository](https://github.com/DanielKeep/rust-custom-derive/tree/custom_derive-master/)

+

+## License

+

+Licensed under either of

+

+* MIT license (see [LICENSE](LICENSE) or <http://opensource.org/licenses/MIT>)

+* Apache License, Version 2.0 (see [LICENSE](LICENSE) or <http://www.apache.org/licenses/LICENSE-2.0>)

+

+at your option.

+

+### Contribution

+

+Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

diff --git a/vendor/custom_derive-0.1.7/src/lib.rs b/vendor/custom_derive-0.1.7/src/lib.rs
new file mode 100644
index 0000000..860945c
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/src/lib.rs
@@ -0,0 +1,462 @@
+/*

+Copyright ⓒ 2016 rust-custom-derive contributors.

+

+Licensed under the MIT license (see LICENSE or <http://opensource.org

+/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of

+<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All

+files in the project carrying such notice may not be copied, modified,

+or distributed except according to those terms.

+*/

+/*!

+**Note**: This crate has been superseded by `macro-attr`.

+

+This crate provides a macro that enables the use of custom `derive` attributes.

+

+To use it, make sure you link to the crate like so:

+

+```rust

+#[macro_use] extern crate custom_derive;

+# macro_rules! Dummy { (() struct $name:ident;) => {}; }

+# custom_derive! { #[derive(Clone, Dummy)] struct Foo; }

+# fn main() { let _ = Foo; }

+```

+

+> **Note**: the `custom_derive!` macro itself is not documented, as the automatic documentation for it would be uselessly huge and incomprehensible.

+

+<style type="text/css">

+.link-block { font-family: "Fira Sans"; }

+.link-block > p { display: inline-block; }

+.link-block > p > strong { font-weight: 500; margin-right: 1em; }

+.link-block > ul { display: inline-block; padding: 0; list-style: none; }

+.link-block > ul > li {

+  font-size: 0.8em;

+  background-color: #eee;

+  border: 1px solid #ccc;

+  padding: 0.3em;

+  display: inline-block;

+}

+</style>

+<span></span><div class="link-block">

+

+**Links**

+

+* [Latest Release](https://crates.io/crates/custom_derive/)

+* [Latest Docs](https://docs.rs/crate/custom_derive/)

+* [Repository](https://github.com/DanielKeep/rust-custom-derive/tree/custom_derive-master/)

+

+<span></span></div>

+

+# Usage

+

+The macro should be used to wrap an entire *single* `enum` or `struct` declaration, including its attributes (both `derive` and others).  All derivation attributes which the macro does *not* recognise will be assumed to be custom, and treated accordingly.

+

+`custom_derive!` assumes that custom derivations are implemented as macros (of the same name).  For example, here is a simple derivation macro:

+

+```rust

+#[macro_use] extern crate custom_derive;

+

+trait TypeName {

+    fn type_name() -> &'static str;

+}

+

+trait ReprType {

+    type Repr;

+}

+

+macro_rules! TypeName {

+    (() $(pub)* enum $name:ident $($tail:tt)*) => { TypeName! { @impl $name } };

+    (() $(pub)* struct $name:ident $($tail:tt)*) => { TypeName! { @impl $name } };

+

+    (@impl $name:ident) => {

+        impl TypeName for $name {

+            fn type_name() -> &'static str { stringify!($name) }

+        }

+    };

+}

+

+macro_rules! TryFrom {

+    (($repr:ty) $(pub)* enum $name:ident $($tail:tt)*) => {

+        impl ReprType for $name {

+            type Repr = $repr;

+        }

+    };

+}

+

+custom_derive! {

+    #[allow(dead_code)]

+    #[repr(u8)]

+    #[derive(Clone, Copy, Debug, TryFrom(u8), TypeName)]

+    enum Foo { A, B }

+}

+

+fn main() {

+    let foo = Foo::B;

+    let v = foo as <Foo as ReprType>::Repr;

+    let msg = format!("{}: {:?} ({:?})", Foo::type_name(), foo, v);

+    assert_eq!(msg, "Foo: B (1)");

+}

+```

+

+First, note that `custom_derive!` passes any arguments on the derivation attribute to the macro.  In the case of attributes *without* any arguments, `()` is passed instead.

+

+Secondly, the macro is passed the entire item, *sans* attributes.  It is the derivation macro's job to parse the item correctly.

+

+Third, each derivation macro is expected to result in zero or more items, not including the item itself.  As a result, it is *not* possible to mutate the item in any way, or attach additional attributes to it.

+

+Finally, `@impl` is merely a trick to pack multiple, different functions into a single macro.  The sequence has no special meaning; it is simply *distinct* from the usual invocation syntax.

+*/

+#![cfg_attr(not(feature = "std"), no_std)]

+

+#[doc(hidden)]

+#[macro_export]

+macro_rules! custom_derive {

+    /*

+

+    > **Convention**: a capture named `$fixed` is used for any part of a recursive rule that is needed in the terminal case, but is not actually being *used* for the recursive part.  This avoids having to constantly repeat the full capture pattern (and makes changing it easier).

+

+    # Primary Invocation Forms

+

+    These need to catch any valid form of struct or enum.

+

+    */

+    (

+        $(#[$($attrs:tt)*])*

+        enum $($it:tt)*

+    ) => {

+        custom_derive! {

+            @split_attrs

+            ($(#[$($attrs)*],)*), (), (),

+            (enum $($it)*)

+        }

+    };

+

+    (

+        $(#[$($attrs:tt)*])*

+        pub $($it:tt)*

+    ) => {

+        custom_derive! {

+            @split_attrs

+            ($(#[$($attrs)*],)*), (), (),

+            (pub $($it)*)

+        }

+    };

+

+    (

+        $(#[$($attrs:tt)*])*

+        struct $($it:tt)*

+    ) => {

+        custom_derive! {

+            @split_attrs

+            ($(#[$($attrs)*],)*), (), (),

+            (struct $($it)*)

+        }

+    };

+

+    /*

+

+    # `@split_attrs`

+

+    This is responsible for dividing all attributes on an item into two groups:

+

+    - `#[derive(...)]`

+    - Everything else.

+

+    As part of this, it also explodes `#[derive(A, B(..), C, ...)]` into `A, B(..), C, ...`.  This is to simplify the next stage.

+

+    */

+    (

+        @split_attrs

+        (),

+        $non_derives:tt,

+        $derives:tt,

+        $it:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            { $non_derives, $it },

+            $derives,

+            (),

+            ()

+        }

+    };

+

+    (

+        @split_attrs

+        (#[derive($($new_drv:ident $(($($new_drv_args:tt)*))*),* $(,)*)], $(#[$($attrs:tt)*],)*),

+        $non_derives:tt,

+        ($($derives:ident,)*),

+        $it:tt

+    ) => {

+        custom_derive! {

+            @split_attrs

+            ($(#[$($attrs)*],)*),

+            $non_derives,

+            ($($derives,)* $($new_drv $(($($new_drv_args)*))*,)*),

+            $it

+        }

+    };

+

+    (

+        @split_attrs

+        (#[$new_attr:meta], $(#[$($attrs:tt)*],)*),

+        ($($non_derives:tt)*),

+        $derives:tt,

+        $it:tt

+    ) => {

+        custom_derive! {

+            @split_attrs

+            ($(#[$($attrs)*],)*),

+            ($($non_derives)* #[$new_attr],),

+            $derives,

+            $it

+        }

+    };

+

+    /*

+

+    # `@split_derive_attrs`

+

+    This is responsible for taking the list of derivation attributes and splitting them into "built-in" and "custom" groups.

+

+    The list of built-in derives currently supported is: Clone, Hash, RustcEncodable, RustcDecodable, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Send, Sync, Copy.

+

+    Anything not on that list is considered "custom".

+

+    And yes, as far as I can see, we *have* to have a separate rule for each of those.  What I wouldn't give for an alternation pattern...

+    */

+

+    (@split_derive_attrs

+        { ($(#[$($non_derives:tt)*],)*), ($($it:tt)*) },

+        (), (), ($($user_drvs:tt)*)

+    ) => {

+        custom_derive! {

+            @as_item

+            $(#[$($non_derives)*])*

+            $($it)*

+        }

+

+        custom_derive! {

+            @expand_user_drvs

+            ($($user_drvs)*), ($($it)*)

+        }

+    };

+

+    (@split_derive_attrs

+        { ($(#[$($non_derives:tt)*],)*), ($($it:tt)*) },

+        (), ($($bi_drvs:ident,)+), ($($user_drvs:tt)*)

+    ) => {

+        custom_derive! {

+            @as_item

+            #[derive($($bi_drvs,)+)]

+            $(#[$($non_derives)*])*

+            $($it)*

+        }

+

+        custom_derive! {

+            @expand_user_drvs

+            ($($user_drvs)*), ($($it)*)

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Hash, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Hash,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Clone, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Clone,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (RustcEncodable, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* RustcEncodable,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (RustcDecodable, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* RustcDecodable,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (PartialEq, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* PartialEq,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Eq, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Eq,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (PartialOrd, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* PartialOrd,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Ord, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Ord,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Debug, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Debug,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Default, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Default,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Send ,$($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Send,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Sync, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Sync,), $user_drvs

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        (Copy, $($tail:tt)*), ($($bi_drvs:ident,)*), $user_drvs:tt

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed,

+            ($($tail)*), ($($bi_drvs,)* Copy,), $user_drvs

+        }

+    };

+

+    /*

+

+    ## Custom Derivations

+

+    Now we can handle the custom derivations.  There are two forms we care about: those *with* an argument, and those *without*.

+

+    The *reason* we care is that, in order to simplify the derivation macros, we want to detect the argument-less case and generate an empty pair of parens.

+

+    */

+    (@split_derive_attrs

+        $fixed:tt,

+        ($new_user:ident, $($tail:tt)*), $bi_drvs:tt, ($($user_drvs:tt)*)

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed, ($($tail)*), $bi_drvs, ($($user_drvs)* $new_user(),)

+        }

+    };

+

+    (@split_derive_attrs

+        $fixed:tt,

+        ($new_user:ident ($($new_user_args:tt)*), $($tail:tt)*), $bi_drvs:tt, ($($user_drvs:tt)*)

+    ) => {

+        custom_derive! {

+            @split_derive_attrs

+            $fixed, ($($tail)*), $bi_drvs, ($($user_drvs)* $new_user($($new_user_args)*),)

+        }

+    };

+

+    /*

+

+    # `@expand_user_drvs`

+

+    Finally, we have a recursive rule for expanding user derivations.  This is basically just using the derivation name as a macro identifier.

+

+    This *has* to be recursive because we need to expand two independent repetition sequences simultaneously, and this causes `macro_rules!` to throw a wobbly.  Don't want that.  So, recursive it is.

+

+    */

+    (@expand_user_drvs

+        (), ($($it:tt)*)

+    ) => {};

+

+    (@expand_user_drvs

+        ($user_drv:ident $arg:tt, $($tail:tt)*), ($($it:tt)*)

+    ) => {

+        $user_drv! { $arg $($it)* }

+        custom_derive! {

+            @expand_user_drvs

+            ($($tail)*), ($($it)*)

+        }

+    };

+

+    /*

+

+    # Miscellaneous Rules

+

+    */

+    (@as_item $($i:item)*) => {$($i)*};

+}

diff --git a/vendor/custom_derive-0.1.7/tests/empty_bi_derives.rs b/vendor/custom_derive-0.1.7/tests/empty_bi_derives.rs
new file mode 100644
index 0000000..6af19ab
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/tests/empty_bi_derives.rs
@@ -0,0 +1,24 @@
+/*

+Copyright ⓒ 2015 rust-custom-derive contributors.

+

+Licensed under the MIT license (see LICENSE or <http://opensource.org

+/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of

+<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All

+files in the project carrying such notice may not be copied, modified,

+or distributed except according to those terms.

+*/

+#[macro_use] extern crate custom_derive;

+

+macro_rules! Dummy {

+    ($($tts:tt)*) => {};

+}

+

+custom_derive! {

+    #[derive(Dummy)]

+    enum Foo { Bar }

+}

+

+#[test]

+fn test_empty_bi_derives() {

+    let _ = Foo::Bar;

+}

diff --git a/vendor/custom_derive-0.1.7/tests/enum_iterator.rs b/vendor/custom_derive-0.1.7/tests/enum_iterator.rs
new file mode 100644
index 0000000..65cef29
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/tests/enum_iterator.rs
@@ -0,0 +1,73 @@
+/*

+Copyright ⓒ 2015 rust-custom-derive contributors.

+

+Licensed under the MIT license (see LICENSE or <http://opensource.org

+/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of

+<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All

+files in the project carrying such notice may not be copied, modified,

+or distributed except according to those terms.

+*/

+#[macro_use] extern crate custom_derive;

+

+macro_rules! EnumIterator {

+    (() $(pub)* enum $name:ident { $($body:tt)* }) => {

+        EnumIterator! {

+            @collect_variants ($name),

+            ($($body)*,) -> ()

+        }

+    };

+

+    (

+        @collect_variants ($name:ident),

+        ($(,)*) -> ($($var_names:ident,)*)

+    ) => {

+        type NameIter = ::std::vec::IntoIter<&'static str>;

+        type VariantIter = ::std::vec::IntoIter<$name>;

+

+        impl $name {

+            #[allow(dead_code)]

+            pub fn iter_variants() -> VariantIter {

+                vec![$($name::$var_names),*].into_iter()

+            }

+

+            #[allow(dead_code)]

+            pub fn iter_variant_names() -> NameIter {

+                vec![$(stringify!($var_names)),*].into_iter()

+            }

+        }

+    };

+

+    (

+        @collect_variants $fixed:tt,

+        ($var:ident $(= $_val:expr)*, $($tail:tt)*) -> ($($var_names:tt)*)

+    ) => {

+        EnumIterator! {

+            @collect_variants $fixed,

+            ($($tail)*) -> ($($var_names)* $var,)

+        }

+    };

+

+    (

+        @collect_variants ($name:ident),

+        ($var:ident $_struct:tt, $($tail:tt)*) -> ($($var_names:tt)*)

+    ) => {

+        const _error: () = concat!(

+            "cannot derive EnumIterator for ",

+            stringify!($name),

+            ", due to non-unitary variant ",

+            stringify!($var),

+            "."

+        );

+    };

+}

+

+custom_derive! {

+    #[derive(Debug, PartialEq, EnumIterator)]

+    enum Get { Up, Down, AllAround }

+}

+

+#[test]

+fn test_enum_iterator() {

+    let vs: Vec<_> = Get::iter_variant_names().zip(Get::iter_variants()).collect();

+    assert_eq!(&*vs, &[("Up", Get::Up), ("Down", Get::Down), ("AllAround", Get::AllAround)]);

+}

diff --git a/vendor/custom_derive-0.1.7/tests/enum_try_from.rs b/vendor/custom_derive-0.1.7/tests/enum_try_from.rs
new file mode 100644
index 0000000..41ad004
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/tests/enum_try_from.rs
@@ -0,0 +1,77 @@
+/*

+Copyright ⓒ 2015 rust-custom-derive contributors.

+

+Licensed under the MIT license (see LICENSE or <http://opensource.org

+/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of

+<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All

+files in the project carrying such notice may not be copied, modified,

+or distributed except according to those terms.

+*/

+#[macro_use] extern crate custom_derive;

+

+trait TryFrom<Src>: Sized {

+    type Err;

+    fn try_from(src: Src) -> Result<Self, Self::Err>;

+}

+

+macro_rules! TryFrom {

+    (($prim:ty) $(pub)* enum $name:ident { $($body:tt)* }) => {

+        TryFrom! {

+            @collect_variants ($name, $prim),

+            ($($body)*,) -> ()

+        }

+    };

+

+    (

+        @collect_variants ($name:ident, $prim:ty),

+        ($(,)*) -> ($($var_names:ident,)*)

+    ) => {

+        impl TryFrom<$prim> for $name {

+            type Err = $prim;

+            fn try_from(src: $prim) -> Result<$name, $prim> {

+                $(

+                    if src == $name::$var_names as $prim {

+                        return Ok($name::$var_names);

+                    }

+                )*

+                Err(src)

+            }

+        }

+    };

+

+    (

+        @collect_variants $fixed:tt,

+        ($var:ident $(= $_val:expr)*, $($tail:tt)*) -> ($($var_names:tt)*)

+    ) => {

+        TryFrom! {

+            @collect_variants $fixed,

+            ($($tail)*) -> ($($var_names)* $var,)

+        }

+    };

+

+    (

+        @collect_variants ($name:ident),

+        ($var:ident $_struct:tt, $($tail:tt)*) -> ($($var_names:tt)*)

+    ) => {

+        const _error: () = concat!(

+            "cannot derive TryFrom for ",

+            stringify!($name),

+            ", due to non-unitary variant ",

+            stringify!($var),

+            "."

+        );

+    };

+}

+

+custom_derive! {

+    #[derive(Debug, PartialEq, TryFrom(u8))]

+    enum Get { Up, Down, AllAround }

+}

+

+#[test]

+fn test_try_from() {

+    assert_eq!(Get::try_from(0u8), Ok(Get::Up));

+    assert_eq!(Get::try_from(1u8), Ok(Get::Down));

+    assert_eq!(Get::try_from(2u8), Ok(Get::AllAround));

+    assert_eq!(Get::try_from(3u8), Err(3u8));

+}

diff --git a/vendor/custom_derive-0.1.7/tests/passthru_derive.rs b/vendor/custom_derive-0.1.7/tests/passthru_derive.rs
new file mode 100644
index 0000000..3ff6242
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/tests/passthru_derive.rs
@@ -0,0 +1,19 @@
+/*

+Copyright ⓒ 2015 rust-custom-derive contributors.

+

+Licensed under the MIT license (see LICENSE or <http://opensource.org

+/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of

+<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All

+files in the project carrying such notice may not be copied, modified,

+or distributed except according to those terms.

+*/

+#[macro_use] extern crate custom_derive;

+extern crate rustc_serialize;

+

+custom_derive! {

+    #[derive(Clone, Hash, RustcEncodable, RustcDecodable, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Copy)]

+    pub struct Dummy(u32);

+}

+

+#[test]

+fn test_passthru_derive() {}

diff --git a/vendor/custom_derive-0.1.7/tests/stable_encodable.rs b/vendor/custom_derive-0.1.7/tests/stable_encodable.rs
new file mode 100644
index 0000000..fddefca
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/tests/stable_encodable.rs
@@ -0,0 +1,378 @@
+/*

+Copyright ⓒ 2015 rust-custom-derive contributors.

+

+Licensed under the MIT license (see LICENSE or <http://opensource.org

+/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of

+<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All

+files in the project carrying such notice may not be copied, modified,

+or distributed except according to those terms.

+*/

+#[macro_use] extern crate custom_derive;

+extern crate rustc_serialize;

+

+macro_rules! StableEncodable {

+    (

+        () $(pub)* enum $name:ident < $($tail:tt)*

+    ) => {

+        StableEncodable! {

+            @extract_gen_args (enum $name),

+            ($($tail)*)

+            -> bounds(), ty_clss(where)

+        }

+    };

+

+    (

+        () $(pub)* enum $name:ident { $($body:tt)* }

+    ) => {

+        StableEncodable! {

+            @impl enum $name,

+            bounds(),

+            ty_clss(),

+            { $($body)* }

+        }

+    };

+

+    (

+        () $(pub)* struct $name:ident { $($body:tt)* }

+    ) => {

+        StableEncodable! {

+            @impl struct $name,

+            bounds(),

+            ty_clss(),

+            { $($body)* }

+        }

+    };

+

+    (

+        () $(pub)* struct $name:ident < $($tail:tt)*

+    ) => {

+        StableEncodable! {

+            @extract_gen_args (struct $name),

+            ($($tail)*)

+            -> bounds(), ty_clss(where)

+        }

+    };

+

+    (

+        @impl enum $name:ident,

+        bounds($($bounds:tt)*),

+        ty_clss($($ty_clss:tt)*),

+        { $($body:tt)* }

+    ) => {

+        StableEncodable! {

+            @parse_variants (enum $name, bounds($($bounds)*), ty_clss($($ty_clss)*)),

+            0usize, ($($body)*,) -> ()

+        }

+    };

+

+    (

+        @impl struct $name:ident,

+        bounds($($bounds:tt)*),

+        ty_clss($($ty_clss:tt)*),

+        { $($fnames:ident: $_ftys:ty),* $(,)* }

+    ) => {

+        StableEncodable! {

+            @as_item

+            impl<$($bounds)*> rustc_serialize::Encodable for $name<$($bounds)*>

+            $($ty_clss)* {

+                fn encode<StableEncodableEncoder>(

+                    &self,

+                    s: &mut StableEncodableEncoder

+                ) -> Result<(), StableEncodableEncoder::Error>

+                where StableEncodableEncoder: rustc_serialize::Encoder {

+                    const NUM_FIELDS: usize = StableEncodable!(@count_tts $($fnames)*);

+                    try!(s.emit_struct(stringify!($name), NUM_FIELDS, |s| {

+                        // Poor man's enumerate!($($fnames)):

+                        let mut idx = 0;

+                        $(

+                            try!(s.emit_struct_field(stringify!($fnames), idx, |s| {

+                                self.$fnames.encode(s)

+                            }));

+                            idx += 1;

+                        )*

+                        let _ = idx;

+                        Ok(())

+                    }));

+                    Ok(())

+                }

+            }

+        }

+    };

+

+    (@as_item $i:item) => {$i};

+

+    (

+        @extract_gen_args ($kind:ident $name:ident),

+        (> { $($tail:tt)* })

+        -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)

+    ) => {

+        StableEncodable! {

+            @impl $kind $name,

+            bounds($($bounds)*),

+            ty_clss($($ty_clss)*),

+            { $($tail)* }

+        }

+    };

+

+    (

+        @extract_gen_args $fixed:tt,

+        ($ty_name:ident: $($tail)*)

+        -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)

+    ) => {

+        StableEncodable! {

+            @skip_inline_bound $fixed,

+            ($($tail)*)

+            -> bounds($($bounds)* $ty_name:),

+               ty_clss($($ty_clss)* $ty_name: ::rustc_serialize::Encodable,)

+        }

+    };

+

+    (

+        @extract_gen_args $fixed:tt,

+        ($ty_name:ident $($tail:tt)*)

+        -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)

+    ) => {

+        StableEncodable! {

+            @extract_gen_args $fixed,

+            ($($tail)*)

+            -> bounds($($bounds)* $ty_name),

+               ty_clss($($ty_clss)* $ty_name: ::rustc_serialize::Encodable,)

+        }

+    };

+

+    (

+        @extract_gen_args $fixed:tt,

+        (, $($tail:tt)*)

+        -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)

+    ) => {

+        StableEncodable! {

+            @extract_gen_args $fixed,

+            ($($tail)*)

+            -> bounds($($bounds)* ,), ty_clss($($ty_clss)*)

+        }

+    };

+

+    (

+        @extract_gen_args $fixed:tt,

+        ($lt:tt $($tail:tt)*)

+        -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)

+    ) => {

+        StableEncodable! {

+            @extract_gen_args $fixed,

+            ($($tail)*)

+            -> bounds($($bounds)* $lt), ty_clss($($ty_clss)*)

+        }

+    };

+

+    (

+        @skip_inline_bound $fixed:tt,

+        (, $($tail:tt)*)

+        -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)

+    ) => {

+        StableEncodable! {

+            @extract_gen_args $fixed,

+            ($($tail)*)

+            -> bounds($($bounds)* ,), ty_clss($($ty_clss)*)

+        }

+    };

+

+    (

+        @skip_inline_bound $fixed:tt,

+        (> { $($tail:tt)* })

+        -> bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)

+    ) => {

+        StableEncodable! {

+            @impl $fixed,

+            bounds($($bounds)*),

+            ty_clss($($ty_clss)*),

+            { $($tail)* }

+        }

+    };

+

+    (

+        @parse_variants (enum $name:ident, bounds($($bounds:tt)*), ty_clss($($ty_clss:tt)*)),

+        $_id:expr, ($(,)*) -> ($($variants:tt)*)

+    ) => {

+        StableEncodable! {

+            @as_item

+            impl<$($bounds)*> rustc_serialize::Encodable for $name<$($bounds)*>

+            $($ty_clss)* {

+                fn encode<StableEncodableEncoder>(

+                    &self,

+                    s: &mut StableEncodableEncoder)

+                -> Result<(), StableEncodableEncoder::Error>

+                where StableEncodableEncoder: rustc_serialize::Encoder {

+                    s.emit_enum(stringify!($name), |s| {

+                        $(

+                            StableEncodable!(@encode_variant $name, $variants, self, s);

+                        )*

+                        unreachable!();

+                    })

+                }

+            }

+        }

+    };

+

+    (

+        @parse_variants $fixed:tt,

+        $id:expr, ($var_name:ident, $($tail:tt)*) -> ($($variants:tt)*)

+    ) => {

+        StableEncodable! {

+            @parse_variants $fixed,

+            ($id + 1usize), ($($tail)*) -> ($($variants)* ($var_name, $id))

+        }

+    };

+

+    (

+        @parse_variants $fixed:tt,

+        $id:expr, ($var_name:ident($(,)*), $($tail:tt)*) -> ($($variants:tt)*)

+    ) => {

+        StableEncodable! {

+            @parse_variants $fixed,

+            ($id + 1usize), ($($tail)*) -> ($($variants)*

+                ($var_name, $id))

+        }

+    };

+

+    (

+        @parse_variants $fixed:tt,

+        $id:expr, ($var_name:ident($_vta:ty), $($tail:tt)*) -> ($($variants:tt)*)

+    ) => {

+        StableEncodable! {

+            @parse_variants $fixed,

+            ($id + 1usize), ($($tail)*) -> ($($variants)*

+                ($var_name, $id, (a)))

+        }

+    };

+

+    (

+        @parse_variants $fixed:tt,

+        $id:expr, ($var_name:ident($_vta:ty, $_vtb:ty), $($tail:tt)*) -> ($($variants:tt)*)

+    ) => {

+        StableEncodable! {

+            @parse_variants $fixed,

+            ($id + 1usize), ($($tail)*) -> ($($variants)*

+                ($var_name, $id, (a, b)))

+        }

+    };

+

+    (

+        @parse_variants $fixed:tt,

+        $id:expr, ($var_name:ident($_vta:ty, $_vtb:ty, $_vtc:ty), $($tail:tt)*) -> ($($variants:tt)*)

+    ) => {

+        StableEncodable! {

+            @parse_variants $fixed,

+            ($id + 1usize), ($($tail)*) -> ($($variants)*

+                ($var_name, $id, (a, b, c)))

+        }

+    };

+

+    (

+        @parse_variants $fixed:tt,

+        $id:expr, ($var_name:ident { $($vfn:ident: $_vft:ty),* $(,)* }, $($tail:tt)*) -> ($($variants:tt)*)

+    ) => {

+        StableEncodable! {

+            @parse_variants $fixed,

+            ($id + 1usize), ($($tail)*) -> ($($variants)*

+                ($var_name, $id, {$($vfn),*}))

+        }

+    };

+

+    (

+        @encode_variant $name:ident,

+        ($var_name:ident, $var_id:expr),

+        $self_:expr, $s:ident

+    ) => {

+        {

+            if let $name::$var_name = *$self_ {

+                return $s.emit_enum_variant(stringify!($var_name), $var_id, 0, |_| Ok(()));

+            }

+        }

+    };

+

+    (

+        @encode_variant $name:ident,

+        ($var_name:ident, $var_id:expr, ($($tup_elems:ident),*)),

+        $self_:expr, $s:ident

+    ) => {

+        {

+            if let $name::$var_name($(ref $tup_elems),*) = *$self_ {

+                return $s.emit_enum_variant(

+                    stringify!($var_name),

+                    $var_id,

+                    StableEncodable!(@count_tts $($tup_elems)*),

+                    |s| {

+                        let mut idx = 0;

+                        $(

+                            try!(s.emit_enum_variant_arg(idx, |s| $tup_elems.encode(s)));

+                            idx += 1;

+                        )*

+                        let _ = idx;

+                        Ok(())

+                    }

+                );

+            }

+        }

+    };

+

+    (

+        @encode_variant $name:ident,

+        ($var_name:ident, $var_id:expr, {$($str_fields:ident),*}),

+        $self_:expr, $s:ident

+    ) => {

+        {

+            if let $name::$var_name { $(ref $str_fields),* } = *$self_ {

+                return $s.emit_enum_struct_variant(

+                    stringify!($var_name),

+                    $var_id,

+                    StableEncodable!(@count_tts $($str_fields)*),

+                    |s| {

+                        let mut idx = 0;

+                        $(

+                            try!(s.emit_enum_struct_variant_field(

+                                stringify!($str_fields),

+                                idx,

+                                |s| $str_fields.encode(s)

+                            ));

+                            idx += 1;

+                        )*

+                        let _ = idx;

+                        Ok(())

+                    }

+                );

+            }

+        }

+    };

+

+    (@count_tts) => {0usize};

+    (@count_tts $_tt:tt $($tail:tt)*) => {1usize + StableEncodable!(@count_tts $($tail)*)};

+}

+

+custom_derive! {

+    #[derive(Debug, StableEncodable)]

+    struct LazyEg<A> { a: A, b: i32, c: (u8, u8, u8) }

+}

+

+custom_derive! {

+    #[derive(Clone, StableEncodable)]

+    enum Wonky<S> { Flim, Flam, Flom(i32), Bees { say: S } }

+}

+

+#[test]

+fn test_stable_encodable() {

+    macro_rules! json {

+        ($e:expr) => (rustc_serialize::json::encode(&$e).unwrap());

+    }

+

+    let lazy_eg = LazyEg {

+        a: String::from("Oh hai!"),

+        b: 42,

+        c: (1, 3, 0),

+    };

+    assert_eq!(&*json!(lazy_eg), r#"{"a":"Oh hai!","b":42,"c":[1,3,0]}"#);

+

+    assert_eq!(&*json!(Wonky::Flim::<()>), r#""Flim""#);

+    assert_eq!(&*json!(Wonky::Flam::<()>), r#""Flam""#);

+    assert_eq!(&*json!(Wonky::Flom::<()>(42)), r#"{"variant":"Flom","fields":[42]}"#);

+    assert_eq!(&*json!(Wonky::Bees{say:"aaaaah!"}), r#"{"variant":"Bees","fields":["aaaaah!"]}"#);

+}

diff --git a/vendor/custom_derive-0.1.7/tests/trailing_comma.rs b/vendor/custom_derive-0.1.7/tests/trailing_comma.rs
new file mode 100644
index 0000000..ba5d097
--- /dev/null
+++ b/vendor/custom_derive-0.1.7/tests/trailing_comma.rs
@@ -0,0 +1,24 @@
+/*

+Copyright ⓒ 2015 rust-custom-derive contributors.

+

+Licensed under the MIT license (see LICENSE or <http://opensource.org

+/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of

+<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All

+files in the project carrying such notice may not be copied, modified,

+or distributed except according to those terms.

+*/

+#[macro_use] extern crate custom_derive;

+

+macro_rules! Dummy {

+    ($($tts:tt)*) => {};

+}

+

+custom_derive! {

+    #[derive(Dummy,)]

+    enum Foo { Bar }

+}

+

+#[test]

+fn test_trailing_comma() {

+    let _ = Foo::Bar;

+}