-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: properly returned Errors instead of panicking in read(), address…
…ing issue #3 reported by Corey Farwell
- Loading branch information
Showing
3 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
extern crate brotli; | ||
|
||
fn main() { | ||
use std::io::{ Cursor, Read }; | ||
use std::io::Read; | ||
use brotli::Decompressor; | ||
|
||
let mut input = vec![]; | ||
let _ = Decompressor::new(Cursor::new(vec![0x1b, 0x3f, 0xff, 0xff, 0xdb, 0x4f, 0xe2, 0x99, 0x80, 0x12])).read_to_end(&mut input); | ||
let mut input = vec![]; | ||
let result = Decompressor::new(&b"\xb1".to_vec() as &[u8]).read_to_end(&mut input); | ||
|
||
println!("result = {:?}", result); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4882090
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing now. Might be good to use pull requests to prevent test-failing code into master?
4882090
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://travis-ci.org/ende76/brotli-rs
4882090
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frewsxcv Yes, seems like it's time for me to call it a day. ;) I have fixed the tests, and will look into the suggested workflow with pull requests for the future. It does sound like the right way to go.