mirror of
https://github.com/facebookexperimental/reverie.git
synced 2025-01-22 12:56:28 +00:00
Replace const_cstr!(...) with c"..." CStr literals
Summary: Supported since Rust 1.77: https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html#c-string-literals Reviewed By: zertosh Differential Revision: D59988483 fbshipit-source-id: 756d79612d6d281ce5dbc7973037a5fdb9526f40
This commit is contained in:
parent
c9c1697a0f
commit
852e08e75d
2 changed files with 6 additions and 17 deletions
|
@ -21,7 +21,6 @@ thiserror = "1.0.49"
|
|||
tokio = { version = "1.37.0", features = ["full", "test-util", "tracing"] }
|
||||
|
||||
[dev-dependencies]
|
||||
const-cstr = "0.3.0"
|
||||
num_cpus = "1.16"
|
||||
raw-cpuid = "10.6.0"
|
||||
tempfile = "3.8"
|
||||
|
|
|
@ -514,8 +514,6 @@ mod tests {
|
|||
use std::ffi::CString;
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
|
||||
use const_cstr::const_cstr;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
|
@ -537,24 +535,16 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_is_dir() {
|
||||
assert!(is_dir(const_cstr!("/").as_ptr()));
|
||||
assert!(is_dir(const_cstr!("/dev").as_ptr()));
|
||||
assert!(!is_dir(const_cstr!("/dev/null").as_ptr()));
|
||||
assert!(is_dir(c"/".as_ptr()));
|
||||
assert!(is_dir(c"/dev".as_ptr()));
|
||||
assert!(!is_dir(c"/dev/null".as_ptr()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_file_type() {
|
||||
assert!(FileType::new(const_cstr!("/").as_ptr()).unwrap().is_dir());
|
||||
assert!(
|
||||
FileType::new(const_cstr!("/dev").as_ptr())
|
||||
.unwrap()
|
||||
.is_dir()
|
||||
);
|
||||
assert!(
|
||||
!FileType::new(const_cstr!("/dev/null").as_ptr())
|
||||
.unwrap()
|
||||
.is_file()
|
||||
);
|
||||
assert!(FileType::new(c"/".as_ptr()).unwrap().is_dir());
|
||||
assert!(FileType::new(c"/dev".as_ptr()).unwrap().is_dir());
|
||||
assert!(!FileType::new(c"/dev/null".as_ptr()).unwrap().is_file());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue