From 8863d37f24ab94a15c3cba9472fb25af24d943e1 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 19 Jan 2016 14:39:23 +1300 Subject: [PATCH] manual fixups --- src/librbml/lib.rs | 25 +++++++++++++++++++------ src/librbml/opaque.rs | 8 ++++---- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index e9e6d8bf1fb..913314c4899 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -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; diff --git a/src/librbml/opaque.rs b/src/librbml/opaque.rs index bed266ae1cc..531a25dc1b7 100644 --- a/src/librbml/opaque.rs +++ b/src/librbml/opaque.rs @@ -14,9 +14,9 @@ use std::io::{self, Write}; use serialize; -// =----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // Encoder -// =----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- pub struct Encoder<'a> { pub cursor: &'a mut io::Cursor>, @@ -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],