Test content, not value

Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
Ralf Jung 2019-08-05 11:21:15 +02:00 committed by GitHub
parent 0d1584507b
commit 4e51ef7ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,7 @@ fn test_as_mut() {
// Pointers to unsized types -- slices
let s: &mut [u8] = &mut [1, 2, 3];
let ms: *mut [u8] = s;
assert_eq!(ms.as_mut().unwrap() as *mut _, s as *mut _);
assert_eq!(ms.as_mut(), Some(&mut [1, 2, 3]));
let mz: *mut [u8] = &mut [];
assert_eq!(mz.as_mut(), Some(&mut [][..]));