1
Fork 0

libstd: remove unnecessary as_slice() calls

This commit is contained in:
Jorge Aparicio 2014-11-27 14:43:55 -05:00
parent 09f7713dd4
commit 60338d91c4
19 changed files with 118 additions and 121 deletions

View file

@ -449,30 +449,30 @@ mod test {
let nread = reader.read(&mut buf);
assert_eq!(Ok(3), nread);
let b: &[_] = &[5, 6, 7];
assert_eq!(buf.as_slice(), b);
assert_eq!(buf, b);
let mut buf = [0, 0];
let nread = reader.read(&mut buf);
assert_eq!(Ok(2), nread);
let b: &[_] = &[0, 1];
assert_eq!(buf.as_slice(), b);
assert_eq!(buf, b);
let mut buf = [0];
let nread = reader.read(&mut buf);
assert_eq!(Ok(1), nread);
let b: &[_] = &[2];
assert_eq!(buf.as_slice(), b);
assert_eq!(buf, b);
let mut buf = [0, 0, 0];
let nread = reader.read(&mut buf);
assert_eq!(Ok(1), nread);
let b: &[_] = &[3, 0, 0];
assert_eq!(buf.as_slice(), b);
assert_eq!(buf, b);
let nread = reader.read(&mut buf);
assert_eq!(Ok(1), nread);
let b: &[_] = &[4, 0, 0];
assert_eq!(buf.as_slice(), b);
assert_eq!(buf, b);
assert!(reader.read(&mut buf).is_err());
}