Created
September 24, 2017 13:58
-
-
Save mitsuhiko/8ee73cb173efe18a49e8598825d89c1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_unsafe_shit() { | |
let data = vec![0u8; 16]; | |
let byteview = ByteView::from_vec(data); | |
let mut x = &[][..]; | |
let handle = ByteViewHandle::from_byteview(byteview, |bytes| -> Result<_, ()> { | |
x = bytes; | |
Ok(bytes) | |
}).unwrap(); | |
assert_eq!(x[0], 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment