GitHub PullRequestReviewCommentEvent at 2014-02-11 16:33:21
Repository: rust-compress
Actor: alexcrichton
Payload: {"comment":{"url":"https://api.github.com/repos/alexcrichton/rust-compress/pulls/comments/9630736","id":9630736,"diff_hunk":"@@ -396,13 +401,31 @@ impl<W: Writer> Writer for Encoder<W> {\n     }\n \n     fn flush(&mut self) -> io::IoResult<()> {\n-        if self.buf.len() > 0 {\n-            if_ok!(self.encode_block());\n-        }\n-        self.w.flush()\n+        self.finish_block().and(self.w.flush())\n     }\n }\n \n+impl<W: FiniteWriter> FiniteWriter for Encoder<W> {\n+    fn write_terminator(&mut self) -> io::IoResult<()> {\n+        let result = self.finish_block();\n+        let result = result.and(self.w.write_le_u32(0));\n+        // XXX: this checksum is wrong\n+        let result = result.and(self.w.write_le_u32(0));\n+        result.and(self.w.write_terminator())\n+    }\n+}\n+\n+impl<W: FiniteWriter> Encoder<W> {","path":"lz4.rs","position":93,"original_position":93,"commit_id":"7bd7b355a5d2b5f0d86656e0b1bb8976970576cc","original_commit_id":"7bd7b355a5d2b5f0d86656e0b1bb8976970576cc","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://gravatar.com/avatar/477e2098d9864b482d28e5ef8e657f43?d=https%3A%2F%2Fidenticons.github.com%2F621df6a7a3377f22b1ae3afc962c3f68.png&r=x","gravatar_id":"477e2098d9864b482d28e5ef8e657f43","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 means that you can't unwrap any stream other than a `FiniteWriter` stream, that seems wrong?","created_at":"2014-02-11T16:33:21Z","updated_at":"2014-02-11T16:33:21Z","html_url":"https://github.com/alexcrichton/rust-compress/pull/11#discussion_r9630736","pull_request_url":"https://api.github.com/repos/alexcrichton/rust-compress/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/alexcrichton/rust-compress/pulls/comments/9630736"},"html":{"href":"https://github.com/alexcrichton/rust-compress/pull/11#discussion_r9630736"},"pull_request":{"href":"https://api.github.com/repos/alexcrichton/rust-compress/pulls/11"}}}}