Fix read_n_i32 function name

This commit is contained in:
Simon Bruder 2020-06-30 12:21:11 +02:00
parent e7c84aed9c
commit 7e76a21609
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
2 changed files with 5 additions and 5 deletions

View file

@ -167,8 +167,8 @@ impl TempoChanges {
let mut cursor = Cursor::new(data);
let count = cursor.read_u32::<LE>()?.try_into()?;
let measure = cursor.read_n_u32(count)?;
let tempo_data = cursor.read_n_u32(count)?;
let measure = cursor.read_n_i32(count)?;
let tempo_data = cursor.read_n_i32(count)?;
let mut entries = Vec::new();
@ -220,7 +220,7 @@ impl Chart {
let mut cursor = Cursor::new(data);
let count = cursor.read_u32::<LE>()?.try_into()?;
let measures = cursor.read_n_u32(count)?;
let measures = cursor.read_n_i32(count)?;
let mut steps = vec![0; count];
cursor.read_exact(&mut steps)?;

View file

@ -24,9 +24,9 @@ pub trait MiniParser: io::Read {
Ok(buf.replace("\0", ""))
}
/// Read `n` `u32`.
/// Read `n` `i32`.
#[inline]
fn read_n_u32(&mut self, n: usize) -> Result<Vec<i32>, MiniParserError> {
fn read_n_i32(&mut self, n: usize) -> Result<Vec<i32>, MiniParserError> {
let mut buf = vec![0; 4 * n];
self.read_exact(&mut buf)?;
Ok(buf