rust/tests/ui/cstring.rs

10 lines
199 B
Rust
Raw Normal View History

2017-10-09 23:15:19 -05:00
fn main() {}
2018-07-28 10:34:52 -05:00
#[allow(clippy::result_unwrap_used)]
2017-10-09 23:15:19 -05:00
fn temporary_cstring() {
use std::ffi::CString;
CString::new("foo").unwrap().as_ptr();
2019-08-09 00:33:07 -05:00
CString::new("foo").expect("dummy").as_ptr();
2017-10-09 23:15:19 -05:00
}