diff --git a/src/lib.rs b/src/lib.rs index b14dfafd339444831bc27151e8ea8b4b35c27e5f..d88f712276811a2df5c8143d7dfa7b0cce47fdc6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -554,7 +554,7 @@ fn convert_to_u32(all: &Vec<u8>, width: u32) -> Vec<Vec<u32>> { let mut data = Vec::new(); for chunk in all.chunks((width * 4) as usize) { let mut row = Vec::new(); - for i in 0 .. width - 1 { + for i in 0 .. width { let start: usize = i as usize * 4; let n = ((chunk[start + 3] as u32) << 24) + ((chunk[start + 2] as u32) << 16) + diff --git a/tests/lib.rs b/tests/lib.rs index 6d3659f235982695220b7036778b1c25330f88ed..3e24cfb7b44dd0068088045a8f4f04caa9bd07fe 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -17,4 +17,5 @@ fn test_gzip_and_zlib_encoded_and_raw_are_the_same() { let c = read_from_file(&Path::new("assets/tiled_csv.tmx")).unwrap(); assert_eq!(z, g); assert_eq!(z, r); + assert_eq!(z, c); }