Make some std::io functions const
Includes: - io::Cursor::new - io::Cursor::get_ref - io::Cursor::position - io::empty - io::repeat - io::sink
This commit is contained in:
@@ -514,3 +514,10 @@ fn test_eq() {
|
||||
|
||||
let _: AssertEq<Cursor<Vec<u8>>> = AssertEq(Cursor::new(Vec::new()));
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn const_cursor() {
|
||||
const CURSOR: Cursor<&[u8]> = Cursor::new(&[0]);
|
||||
const _: &&[u8] = CURSOR.get_ref();
|
||||
const _: u64 = CURSOR.position();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user