diff --git a/source/durandal/bin.rs b/source/durandal/bin.rs index 6ab78ca..0d0827c 100644 --- a/source/durandal/bin.rs +++ b/source/durandal/bin.rs @@ -374,8 +374,9 @@ pub fn rd_array(b: &[u8], read: F) -> ResultS> /// # Errors /// /// Execution will return the result of `read` if `read` returns an error. -pub fn rd_array_num(b: &[u8], n: usize, read: F) - -> ResultS<(Vec, usize)> +pub fn rd_array_num(b: &[u8], + n: usize, + read: F) -> ResultS<(Vec, usize)> where T: Sized, F: Fn(&[u8]) -> ResultS<(T, usize)> { @@ -409,8 +410,7 @@ pub fn rd_array_num(b: &[u8], n: usize, read: F) pub fn rd_ofstable(b: &[u8], mut p: usize, num: usize, - read: F) - -> ResultS> + read: F) -> ResultS> where T: Sized, F: Fn(&[u8]) -> ResultS { diff --git a/source/durandal/sound.rs b/source/durandal/sound.rs index 756ae3d..acf46c7 100644 --- a/source/durandal/sound.rs +++ b/source/durandal/sound.rs @@ -45,8 +45,7 @@ impl Sound16 } /// Creates a new `Sound16` from an unsigned 8-bit stream. - pub fn new_from_8(rate: u16, lp_beg: usize, lp_end: usize, b: &[u8]) - -> Self + pub fn new_from_8(rate: u16, lp_beg: usize, lp_end: usize, b: &[u8]) -> Self { let mut snd = Self::new(rate, lp_beg, lp_end, b.len()); @@ -58,8 +57,7 @@ impl Sound16 } /// Creates a new `Sound16` from a signed 16-bit stream. - pub fn new_from_16(rate: u16, lp_beg: usize, lp_end: usize, b: &[u8]) - -> Self + pub fn new_from_16(rate: u16, lp_beg: usize, lp_end: usize, b: &[u8]) -> Self { let mut snd = Self::new(rate, lp_beg, lp_end, b.len() / 2); diff --git a/source/marathon/defl.rs b/source/marathon/defl.rs index 7ed0c4d..db5f220 100644 --- a/source/marathon/defl.rs +++ b/source/marathon/defl.rs @@ -214,8 +214,7 @@ fn stream_literal(v: &mut Vec, b: &[u8], p: usize) -> ResultS fn read_alphabet(b: &[u8], mut p: usize, alphabet: &mut [u16], - code_table: HuffmanTable) - -> ResultS + code_table: HuffmanTable) -> ResultS { let mut i = 0; while i < alphabet.len() { @@ -280,8 +279,7 @@ fn output_tables(v: &mut Vec, b: &[u8], mut p: usize, table_len: HuffmanTable, - table_dst: HuffmanTable) - -> ResultS + table_dst: HuffmanTable) -> ResultS { const LEN_BASE: [usize; 29] = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, diff --git a/source/marathon/map/entr.rs b/source/marathon/map/entr.rs index 6f34db1..58a372c 100644 --- a/source/marathon/map/entr.rs +++ b/source/marathon/map/entr.rs @@ -10,8 +10,7 @@ pub fn read(b: &[u8], old_dat: bool, siz_app: usize, siz_ent: usize, - siz_cnk: usize) - -> ResultS + siz_cnk: usize) -> ResultS { read_data! { endian: BIG, buf: b, size: 128, start: 0, data { diff --git a/source/marathon/shp.rs b/source/marathon/shp.rs index c8ebc3d..e46e4a3 100644 --- a/source/marathon/shp.rs +++ b/source/marathon/shp.rs @@ -9,8 +9,9 @@ pub mod sequ; use crate::durandal::{bin::usize_from_u32, err::*}; /// Reads a collection at an offset provided by the Shapes header. -pub fn read_coll_at_offset(b: &[u8], ofs: u32, len: usize) - -> ResultS> +pub fn read_coll_at_offset(b: &[u8], + ofs: u32, + len: usize) -> ResultS> { if ofs != u32::max_value() { let ofs = usize_from_u32(ofs); diff --git a/source/marathon/shp/clut.rs b/source/marathon/shp/clut.rs index 71ff8f0..1654c7c 100644 --- a/source/marathon/shp/clut.rs +++ b/source/marathon/shp/clut.rs @@ -29,8 +29,10 @@ pub fn read_color(b: &[u8], clut: &mut [ColorShp]) -> ResultS<()> } /// Reads color tables from `b`. -pub fn read(b: &[u8], tab_ofs: usize, tab_num: usize, clr_num: usize) - -> ResultS> +pub fn read(b: &[u8], + tab_ofs: usize, + tab_num: usize, + clr_num: usize) -> ResultS> { let end = tab_num * clr_num * 8;