diff options
| author | Alex Macleod <alex@macleod.io> | 2022-08-29 12:07:59 +0000 |
|---|---|---|
| committer | Alex Macleod <alex@macleod.io> | 2022-08-29 12:17:08 +0000 |
| commit | c5a82304cf3ce4460df35a8cd0073c22bf0e5c64 (patch) | |
| tree | 5722de2783941894124625273b0b6734fa833194 | |
| parent | 28ec27b33acc513a6534eb0d310caf7700800205 (diff) | |
| download | rust-c5a82304cf3ce4460df35a8cd0073c22bf0e5c64.tar.gz rust-c5a82304cf3ce4460df35a8cd0073c22bf0e5c64.zip | |
Fix `suspicious_to_owned` test when `c_char` is `u8`
| -rw-r--r-- | tests/ui/suspicious_to_owned.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/suspicious_to_owned.rs b/tests/ui/suspicious_to_owned.rs index a90e78a0ea0..cba21bf4a93 100644 --- a/tests/ui/suspicious_to_owned.rs +++ b/tests/ui/suspicious_to_owned.rs @@ -2,12 +2,12 @@ #![warn(clippy::implicit_clone)] #![allow(clippy::redundant_clone)] use std::borrow::Cow; -use std::ffi::CStr; +use std::ffi::{c_char, CStr}; fn main() { let moo = "Moooo"; let c_moo = b"Moooo\0"; - let c_moo_ptr = c_moo.as_ptr() as *const i8; + let c_moo_ptr = c_moo.as_ptr() as *const c_char; let moos = ['M', 'o', 'o']; let moos_vec = moos.to_vec(); |
