Use iter() instead of into_iter() where appropriate.
This commit is contained in:
parent
3c928122eb
commit
faefc75601
|
@ -364,9 +364,8 @@ fn parse_rational<E>(data: &[u8], offset: usize, count: usize)
|
|||
}
|
||||
|
||||
fn parse_sbyte(data: &[u8], offset: usize, count: usize) -> Value {
|
||||
let bytes = data[offset .. offset + count].into_iter()
|
||||
.map(|x| *x as i8)
|
||||
.collect();
|
||||
let bytes = data[offset .. offset + count].iter()
|
||||
.map(|x| *x as i8).collect();
|
||||
Value::SByte(bytes)
|
||||
}
|
||||
|
||||
|
|
|
@ -502,9 +502,7 @@ fn compose_value<E>(value: &Value)
|
|||
Ok((5, vec.len(), buf))
|
||||
},
|
||||
Value::SByte(ref vec) => {
|
||||
let bytes = vec.into_iter()
|
||||
.map(|x| *x as u8)
|
||||
.collect();
|
||||
let bytes = vec.iter().map(|x| *x as u8).collect();
|
||||
Ok((6, vec.len(), bytes))
|
||||
},
|
||||
Value::Undefined(ref s, _) =>
|
||||
|
|
Loading…
Reference in New Issue