manual fixups

This commit is contained in:
Nick Cameron 2016-01-19 14:39:23 +13:00
parent 7c2bfd12a0
commit 8863d37f24
2 changed files with 23 additions and 10 deletions

View File

@ -217,10 +217,15 @@ pub enum EbmlEncoderTag {
const NUM_TAGS: usize = 0x1000;
const NUM_IMPLICIT_TAGS: usize = 0x0e;
static TAG_IMPLICIT_LEN: [i8; NUM_IMPLICIT_TAGS] = [1, 2, 4, 8 /* EsU* */, 1, 2, 4,
8 /* ESI* */, 1 /* EsBool */,
4 /* EsChar */, 4, 8 /* EsF* */, 1,
4 /* EsSub* */];
#[cfg_attr(rustfmt, rustfmt_skip)]
static TAG_IMPLICIT_LEN: [i8; NUM_IMPLICIT_TAGS] = [
1, 2, 4, 8, // EsU*
1, 2, 4, 8, // ESI*
1, // EsBool
4, // EsChar
4, 8, // EsF*
1, 4, // EsSub*
];
#[derive(Debug)]
pub enum Error {
@ -1444,8 +1449,16 @@ mod tests {
#[test]
fn test_vuint_at() {
let data = &[0x80, 0xff, 0x40, 0x00, 0x7f, 0xff, 0x20, 0x00, 0x00, 0x3f, 0xff, 0xff, 0x10,
0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff];
let data = &[
0x80,
0xff,
0x40, 0x00,
0x7f, 0xff,
0x20, 0x00, 0x00,
0x3f, 0xff, 0xff,
0x10, 0x00, 0x00, 0x00,
0x1f, 0xff, 0xff, 0xff
];
let mut res: reader::Res;

View File

@ -14,9 +14,9 @@
use std::io::{self, Write};
use serialize;
// =-----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Encoder
// =-----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
pub struct Encoder<'a> {
pub cursor: &'a mut io::Cursor<Vec<u8>>,
@ -261,9 +261,9 @@ pub fn from_rbml<'b: 'c, 'c>(rbml: &'c mut ::writer::Encoder<'b>) -> Encoder<'c>
}
}
// =-----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Decoder
// =-----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
pub struct Decoder<'a> {
pub data: &'a [u8],