{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/23896249","id":23896249,"diff_hunk":"@@ -0,0 +1,928 @@\n+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT\n+// file at the top-level directory of this distribution and at\n+// http://rust-lang.org/COPYRIGHT.\n+//\n+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n+// option. This file may not be copied, modified, or distributed\n+// except according to those terms.\n+\n+//! Traits, helpers, and type definitions for core I/O functionality.\n+//!\n+//! > **NOTE**: This module is very much a work in progress and is under active\n+//! > development. At this time it is still recommended to use the `old_io`\n+//! > module while the details of this module shake out.\n+\n+#![unstable(feature = \"io\",\n+            reason = \"this new I/O module is still under active deveopment and \\\n+                      APIs are subject to tweaks fairly regularly\")]\n+\n+use cmp;\n+use unicode::str as core_str;\n+use error::Error as StdError;\n+use fmt;\n+use iter::Iterator;\n+use marker::Sized;\n+use mem;\n+use ops::{Drop, FnOnce};\n+use option::Option::{self, Some, None};\n+use ptr::PtrExt;\n+use result::Result::{Ok, Err};\n+use result;\n+use slice::{self, SliceExt};\n+use string::String;\n+use str::{self, StrExt};\n+use vec::Vec;\n+\n+pub use self::buffered::{BufReader, BufWriter, BufStream, LineWriter};\n+pub use self::cursor::Cursor;\n+pub use self::error::{Result, Error, ErrorKind};\n+pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat};\n+\n+pub mod prelude;\n+mod buffered;\n+mod cursor;\n+mod error;\n+mod impls;\n+mod util;\n+\n+const DEFAULT_BUF_SIZE: usize = 64 * 1024;\n+\n+// Acquires a slice of the vector `v` from its length to its capacity\n+// (uninitialized data), reads into it, and then updates the length.\n+//\n+// This function is leveraged to efficiently read some bytes into a destination\n+// vector without extra copying and taking advantage of the space that's already\n+// in `v`.\n+//\n+// The buffer we're passing down, however, is pointing at uninitialized data\n+// (the end of a `Vec`), and many operations will be *much* faster if we don't\n+// have to zero it out. In order to prevent LLVM from generating an `undef`\n+// value when reads happen from this uninitialized memory, we force LLVM to\n+// think it's initialized by sending it through a black box. This should prevent\n+// actual undefined behavior after optimizations.\n+fn with_end_to_cap<F>(v: &mut Vec<u8>, f: F) -> Result<usize>\n+    where F: FnOnce(&mut [u8]) -> Result<usize>\n+{\n+    unsafe {\n+        let n = try!(f({\n+            let base = v.as_mut_ptr().offset(v.len() as isize);\n+            black_box(slice::from_raw_mut_buf(mem::copy_lifetime(v, &base),\n+                                              v.capacity() - v.len()))\n+        }));\n+\n+        // If the closure (typically a `read` implementation) reported that it\n+        // read a larger number of bytes than the vector actually has, we need\n+        // to be sure to clamp the vector to at most its capacity.\n+        let new_len = cmp::min(v.capacity(), v.len() + n);\n+        v.set_len(new_len);\n+        return Ok(n);\n+    }\n+\n+    // Semi-hack used to prevent LLVM from retaining any assumptions about\n+    // `dummy` over this function call\n+    unsafe fn black_box<T>(dummy: T) -> T {\n+        asm!(\"\" : : \"r\"(&dummy));\n+        dummy\n+    }\n+}\n+\n+// A few methods below (read_to_string, read_line) will append data into a\n+// `String` buffer, but we need to be pretty careful when doing this. The\n+// implementation will just call `.as_mut_vec()` and then delegate to a\n+// byte-oriented reading method, but we must ensure that when returning we never\n+// leave `buf` in a state such that it contains invalid UTF-8 in its bounds.\n+//\n+// To this end, we use an RAII guard (to protect against panics) which updates\n+// the length of the string when it is dropped. This guard initially truncates\n+// the string to the prior length and only afer we've validated that the\n+// new contents are valid UTF-8 do we allow it to set a longer length.\n+//\n+// The unsafety in this function is twofold:\n+//\n+// 1. We're looking at the raw bytes of `buf`, so we take on the burden of UTF-8\n+//    checks.\n+// 2. We're passing a raw buffer to the function `f`, and it is expected that\n+//    the function only *appends* bytes to the buffer. We'll get undefined\n+//    behavior if existing bytes are overwritten to have non-UTF-8 data.\n+fn append_to_string<F>(buf: &mut String, f: F) -> Result<()>\n+    where F: FnOnce(&mut Vec<u8>) -> Result<()>\n+{\n+    struct Guard<'a> { s: &'a mut Vec<u8>, len: usize }\n+    #[unsafe_destructor]\n+    impl<'a> Drop for Guard<'a> {\n+        fn drop(&mut self) {\n+            unsafe { self.s.set_len(self.len); }\n+        }\n+    }\n+\n+    unsafe {\n+        let mut g = Guard { len: buf.len(), s: buf.as_mut_vec() };\n+        let ret = f(g.s);\n+        if str::from_utf8(&g.s[g.len..]).is_err() {\n+            ret.and_then(|()| {\n+                Err(Error::new(ErrorKind::InvalidInput,\n+                               \"stream did not contain valid UTF-8\", None))\n+            })\n+        } else {\n+            g.len = g.s.len();\n+            ret\n+        }\n+    }\n+}\n+\n+fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<()> {\n+    loop {\n+        if buf.capacity() == buf.len() {\n+            buf.reserve(DEFAULT_BUF_SIZE);\n+        }\n+        match with_end_to_cap(buf, |b| r.read(b)) {\n+            Ok(0) => return Ok(()),\n+            Ok(_) => {}\n+            Err(ref e) if e.kind() == ErrorKind::Interrupted => {}\n+            Err(e) => return Err(e),\n+        }\n+    }\n+}\n+\n+/// A trait for objects which are byte-oriented sources.\n+///\n+/// Readers are defined by one method, `read`. Each call to `read` will attempt\n+/// to pull bytes from this source into a provided buffer.\n+///\n+/// Readers are intended to be composable with one another. Many objects\n+/// throughout the I/O and related libraries take and provide types which\n+/// implement the `Read` trait.\n+pub trait Read {\n+    /// Pull some bytes from this source into the specified buffer, returning\n+    /// how many bytes were read.\n+    ///\n+    /// This function does not provide any guarantees about whether it blocks\n+    /// waiting for data, but if an object needs to block for a read but cannot\n+    /// it will typically signal this via an `Err` return value.\n+    ///\n+    /// If the return value of this method is `Ok(n)`, then it must be\n+    /// guaranteed that `0 <= n <= buf.len()`. If `n` is `0` then it indicates\n+    /// that this reader as reached \"end of file\" and will likely no longer be\n+    /// able to produce more bytes, but this is not guaranteed, however. A\n+    /// nonzero `n` value indicates that the buffer `buf` has been filled in\n+    /// with `n` bytes of data from this source.\n+    ///\n+    /// No guarantees are provided about the contents of `buf` when this\n+    /// function is called, implementations cannot rely on any property of the\n+    /// contents of `buf` being true.\n+    ///\n+    /// # Errors\n+    ///\n+    /// If this function encounters any form of I/O or other error, an error\n+    /// variant will be returned. If an error is returned then it is guaranteed\n+    /// that no bytes were read successfully.\n+    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;\n+\n+    /// Read all remaining bytes in this source, placing them into `buf`.\n+    ///\n+    /// This function will continuously invoke `read` until `Ok(0)` or an error\n+    /// is reached, at which point this function will immediately return.\n+    ///\n+    /// This function will only successfully return if an invocation of `Ok(0)`\n+    /// succeeds at which point all bytes have been read into `buf`.\n+    ///\n+    /// # Errors\n+    ///\n+    /// If this function encounters an error of the kind\n+    /// `ErrorKind::Interrupted` then the error is ignored and the operation\n+    /// will continue.\n+    ///\n+    /// If any other read error is encountered then this function immediately\n+    /// returns. Any bytes which have already been read will be present in\n+    /// `buf` and the length will be adjusted appropriately.\n+    fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<()> {\n+        read_to_end(self, buf)\n+    }\n+\n+    /// Read all remaining bytes in this source, placing them into `buf`.\n+    ///\n+    /// # Errors\n+    ///\n+    /// If the data in this stream is *not* valid UTF-8 then an error is\n+    /// returned and the length of `buf` is not adjusted.\n+    ///\n+    /// See `read_to_end` for other error semantics.\n+    fn read_to_string(&mut self, buf: &mut String) -> Result<()> {\n+        // Note that we do *not* call `.read_to_end()` here. We are passing\n+        // `&mut Vec<u8>` (the raw contents of `buf`) into the `read_to_end`\n+        // method to fill it up. An arbitrary implementation could overwrite the\n+        // entire contents of the vector, not just append to it (which is what\n+        // we are expecting).\n+        //\n+        // To prevent extraneously checking the UTF-8-ness of the entire buffer\n+        // we pass it to our hardcoded `read_to_end` implementation which we\n+        // know is guaranteed to only read data into the end of the buffer.\n+        append_to_string(buf, |b| read_to_end(self, b))\n+    }\n+}\n+\n+/// Extension methods for all instances of `Read`, typically imported through\n+/// `std::io::prelude::*`.\n+pub trait ReadExt: Read + Sized {\n+    /// Create a \"by reference\" adaptor for this instance of `Read`.\n+    ///\n+    /// The returned adaptor also implements `Read` and will simply borrow this\n+    /// current reader.\n+    fn by_ref(&mut self) -> &mut Self { self }\n+\n+    /// Transform this `Read` instance to an `Iterator` over its bytes.\n+    ///\n+    /// The returned type implements `Iterator` where the `Item` is `Result<u8,\n+    /// R::Err>`.  The yielded item is `Ok` if a byte was successfully read and\n+    /// `Err` otherwise for I/O errors. EOF is mapped to returning `None` for\n+    /// this iterator.\n+    fn bytes(self) -> Bytes<Self> {\n+        Bytes { inner: self }\n+    }\n+\n+    /// Transform this `Read` instance to an `Iterator` over `char`s.\n+    ///\n+    /// This adaptor will attempt to interpret this reader as an UTF-8 encoded\n+    /// sequence of characters. The returned iterator will return `None` once\n+    /// EOF is reached for this reader (and it's not in the middle of decoding a\n+    /// character). Otherwise each element yielded will be a `Result<char, E>`\n+    /// where `E` may contain information about what I/O error occurred or where\n+    /// decoding failed.\n+    ///\n+    /// Currently this adaptor will discard intermediate data read, and should\n+    /// be avoided if this is not desired.\n+    fn chars(self) -> Chars<Self> {\n+        Chars { inner: self }\n+    }\n+\n+    /// Create an adaptor which will chain this stream with another.\n+    ///\n+    /// The returned instance of `Read` will yield all this object's bytes\n+    /// until EOF is reached. Afterwards the bytes of `next` will be yielded\n+    /// infinitely.\n+    fn chain<R: Read>(self, next: R) -> Chain<Self, R> {\n+        Chain { first: self, second: next, done_first: false }\n+    }\n+\n+    /// Create an adaptor which will read at most `limit` bytes from it.\n+    ///\n+    /// This function returns a new instance of `Read` which will read at most\n+    /// `limit` bytes, after which it will always return EOF (`Ok(0)`). Any\n+    /// read errors will not count towards the number of bytes read and future\n+    /// calls to `read` may succeed.\n+    fn take(self, limit: u64) -> Take<Self> {\n+        Take { inner: self, limit: limit }\n+    }\n+\n+    /// Creates a reader adaptor which will write all read data into the given\n+    /// output stream.\n+    ///\n+    /// Whenever the returned `Read` instance is read it will write the read\n+    /// data to `out`. The current semantics of this implementation imply that\n+    /// a `write` error will not report how much data was initially read.\n+    fn tee<W: Write>(self, out: W) -> Tee<Self, W> {\n+        Tee { reader: self, writer: out }\n+    }\n+}\n+\n+impl<T: Read> ReadExt for T {}\n+\n+/// A trait for objects which are byte-oriented sink.\n+///\n+/// Writers are defined by one method, `write`. This function will attempt to\n+/// write some data into the object, returning how many bytes were successfully\n+/// written.\n+///\n+/// Another commonly overridden method is the `flush` method for writers such as\n+/// buffered writers.\n+///\n+/// Writers are intended to be composable with one another. Many objects\n+/// throughout the I/O and related libraries take and provide types which\n+/// implement the `Write` trait.\n+pub trait Write {\n+    /// Write a buffer into this object, returning how many bytes were read.\n+    ///\n+    /// This function will attempt to write the entire contents of `buf`, but\n+    /// the entire write may not succeed, or the write may also generate an\n+    /// error. A call to `write` represents *at most one* attempt to write to\n+    /// any wrapped object.\n+    ///\n+    /// Calls to `write` are not guaranteed to block waiting for data to be\n+    /// written, and a write which would otherwise block is indicated through an\n+    /// `Err` variant.\n+    ///\n+    /// If the return value is `Ok(n)` then it must be guaranteed that\n+    /// `0 <= n <= buf.len()`. A return value of `0` typically means that the\n+    /// underlying object is no longer able to accept bytes and will likely not\n+    /// be able to in the future as well, or that the buffer provided is empty.\n+    ///\n+    /// # Errors\n+    ///\n+    /// Each call to `write` may generate an I/O error indicating that the\n+    /// operation could not be completed. If an error is returned then no bytes\n+    /// in the buffer were successfully written to this writer.\n+    ///\n+    /// It is **not** considered an error if the entire buffer could not be\n+    /// written to this writer.\n+    fn write(&mut self, buf: &[u8]) -> Result<usize>;\n+\n+    /// Flush this output stream, ensuring that all intermediately buffered\n+    /// contents reach their destination.\n+    ///\n+    /// This is by default a no-op and implementers of the `Write` trait should\n+    /// decide whether their stream needs to be buffered or not.\n+    fn flush(&mut self) -> Result<()> { Ok(()) }\n+\n+    /// Attempts to write an entire buffer into this write.\n+    ///\n+    /// This method will continuously call `write` while there is more data to\n+    /// write. This method will not return until the entire buffer has been\n+    /// successfully written or an error occurs. The first error generated from\n+    /// this method will be returned.\n+    ///\n+    /// # Errors\n+    ///\n+    /// This function will return the first error that `write` returns.\n+    fn write_all(&mut self, mut buf: &[u8]) -> Result<()> {\n+        while buf.len() > 0 {\n+            match self.write(buf) {\n+                Ok(0) => return Err(Error::new(ErrorKind::EndOfFile,\n+                                               \"failed to write whole buffer: \\\n+                                                eof reached\", None)),","path":"src/libstd/io/mod.rs","position":353,"original_position":353,"commit_id":"7aaa7ded38577a22fb0d84b4e5cc242f7263b44a","original_commit_id":"7aaa7ded38577a22fb0d84b4e5cc242f7263b44a","user":{"login":"nagisa","id":679122,"avatar_url":"https://avatars.githubusercontent.com/u/679122?v=3","gravatar_id":"","url":"https://api.github.com/users/nagisa","html_url":"https://github.com/nagisa","followers_url":"https://api.github.com/users/nagisa/followers","following_url":"https://api.github.com/users/nagisa/following{/other_user}","gists_url":"https://api.github.com/users/nagisa/gists{/gist_id}","starred_url":"https://api.github.com/users/nagisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nagisa/subscriptions","organizations_url":"https://api.github.com/users/nagisa/orgs","repos_url":"https://api.github.com/users/nagisa/repos","events_url":"https://api.github.com/users/nagisa/events{/privacy}","received_events_url":"https://api.github.com/users/nagisa/received_events","type":"User","site_admin":false},"body":"This is `Write`, not `Read`. Ok(0) does not signify EOFs, does it? I’d use `ErrorKind::Other` or something here.","created_at":"2015-02-01T09:54:43Z","updated_at":"2015-02-01T09:54:43Z","html_url":"https://github.com/rust-lang/rust/pull/21835#discussion_r23896249","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/21835","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/23896249"},"html":{"href":"https://github.com/rust-lang/rust/pull/21835#discussion_r23896249"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/21835"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/21835","id":28427828,"html_url":"https://github.com/rust-lang/rust/pull/21835","diff_url":"https://github.com/rust-lang/rust/pull/21835.diff","patch_url":"https://github.com/rust-lang/rust/pull/21835.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/21835","number":21835,"state":"open","locked":false,"title":"std: Add `io` module again","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"body":"This commit is an implementation of [RFC 576][rfc] which adds back the `std::io`\r\nmodule to the standard library. No functionality in `std::old_io` has been\r\ndeprecated just yet, and the new `std::io` module is behind the same `io`\r\nfeature gate.\r\n\r\n[rfc]: https://github.com/rust-lang/rfcs/pull/576\r\n\r\nA good bit of functionality was copied over from `std::old_io`, but many tweaks\r\nwere required for the new method signatures. Behavior such as precisely when\r\nbuffered objects call to the underlying object may have been tweaked slightly in\r\nthe transition. All implementations were audited to use composition wherever\r\npossible. For example the custom `pos` and `cap` cursors in `BufReader` were\r\nremoved in favor of just using `Cursor<Vec<u8>>`.\r\n\r\nA few liberties were taken during this implementation which were not explicitly\r\nspelled out in the RFC:\r\n\r\n* The old `LineBufferedWriter` is now named `LineWriter`\r\n* The internal representation of `Error` now favors OS error codes (a\r\n  0-allocation path) and contains a `Box` for extra semantic data.\r\n* The io prelude currently reexports `Seek` as `NewSeek` to prevent conflicts\r\n  with the real prelude reexport of `old_io::Seek`\r\n* The `chars` method was moved from `BufReadExt` to `ReadExt`.\r\n* The `chars` iterator returns a custom error with a variant that explains that\r\n  the data was not valid UTF-8.","created_at":"2015-02-01T07:39:54Z","updated_at":"2015-02-01T09:54:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86e3905686074cc98038e03ef988f1be63743b80","assignee":{"login":"aturon","id":709807,"avatar_url":"https://avatars.githubusercontent.com/u/709807?v=3","gravatar_id":"","url":"https://api.github.com/users/aturon","html_url":"https://github.com/aturon","followers_url":"https://api.github.com/users/aturon/followers","following_url":"https://api.github.com/users/aturon/following{/other_user}","gists_url":"https://api.github.com/users/aturon/gists{/gist_id}","starred_url":"https://api.github.com/users/aturon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aturon/subscriptions","organizations_url":"https://api.github.com/users/aturon/orgs","repos_url":"https://api.github.com/users/aturon/repos","events_url":"https://api.github.com/users/aturon/events{/privacy}","received_events_url":"https://api.github.com/users/aturon/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/21835/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/21835/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/21835/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/7aaa7ded38577a22fb0d84b4e5cc242f7263b44a","head":{"label":"alexcrichton:iov2","ref":"iov2","sha":"7aaa7ded38577a22fb0d84b4e5cc242f7263b44a","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"repo":{"id":7385331,"name":"rust","full_name":"alexcrichton/rust","owner":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexcrichton/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/alexcrichton/rust","forks_url":"https://api.github.com/repos/alexcrichton/rust/forks","keys_url":"https://api.github.com/repos/alexcrichton/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexcrichton/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexcrichton/rust/teams","hooks_url":"https://api.github.com/repos/alexcrichton/rust/hooks","issue_events_url":"https://api.github.com/repos/alexcrichton/rust/issues/events{/number}","events_url":"https://api.github.com/repos/alexcrichton/rust/events","assignees_url":"https://api.github.com/repos/alexcrichton/rust/assignees{/user}","branches_url":"https://api.github.com/repos/alexcrichton/rust/branches{/branch}","tags_url":"https://api.github.com/repos/alexcrichton/rust/tags","blobs_url":"https://api.github.com/repos/alexcrichton/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexcrichton/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexcrichton/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexcrichton/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexcrichton/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/alexcrichton/rust/languages","stargazers_url":"https://api.github.com/repos/alexcrichton/rust/stargazers","contributors_url":"https://api.github.com/repos/alexcrichton/rust/contributors","subscribers_url":"https://api.github.com/repos/alexcrichton/rust/subscribers","subscription_url":"https://api.github.com/repos/alexcrichton/rust/subscription","commits_url":"https://api.github.com/repos/alexcrichton/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexcrichton/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexcrichton/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexcrichton/rust/issues/comments/{number}","contents_url":"https://api.github.com/repos/alexcrichton/rust/contents/{+path}","compare_url":"https://api.github.com/repos/alexcrichton/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexcrichton/rust/merges","archive_url":"https://api.github.com/repos/alexcrichton/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexcrichton/rust/downloads","issues_url":"https://api.github.com/repos/alexcrichton/rust/issues{/number}","pulls_url":"https://api.github.com/repos/alexcrichton/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/alexcrichton/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/alexcrichton/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexcrichton/rust/labels{/name}","releases_url":"https://api.github.com/repos/alexcrichton/rust/releases{/id}","created_at":"2012-12-31T08:59:51Z","updated_at":"2014-12-22T16:32:12Z","pushed_at":"2015-02-01T07:50:44Z","git_url":"git://github.com/alexcrichton/rust.git","ssh_url":"git@github.com:alexcrichton/rust.git","clone_url":"https://github.com/alexcrichton/rust.git","svn_url":"https://github.com/alexcrichton/rust","homepage":"http://www.rust-lang.org","size":236989,"stargazers_count":1,"watchers_count":1,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"incoming"}},"base":{"label":"rust-lang:master","ref":"master","sha":"a2aee6290a5ab90db7de881cf945840547d565a8","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"a safe, concurrent, practical language","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments/{number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","created_at":"2010-06-16T20:39:03Z","updated_at":"2015-02-01T09:11:11Z","pushed_at":"2015-02-01T07:21:14Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"http://www.rust-lang.org","size":460205,"stargazers_count":9156,"watchers_count":9156,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1761,"mirror_url":null,"open_issues_count":2048,"forks":1761,"open_issues":2048,"watchers":9156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/21835"},"html":{"href":"https://github.com/rust-lang/rust/pull/21835"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/21835"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/21835/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/21835/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/21835/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/7aaa7ded38577a22fb0d84b4e5cc242f7263b44a"}}}}