Remove FsPath and FsPathMnt trait

Directly use Utf8CStr
This commit is contained in:
topjohnwu
2025-04-23 17:34:59 -07:00
committed by John Wu
parent 610945ac54
commit 3327fc668e
21 changed files with 62 additions and 89 deletions

View File

@@ -11,7 +11,7 @@ use std::str::Utf8Error;
use std::{fmt, mem, slice, str};
use thiserror::Error;
use crate::{FsPath, FsPathMnt, slice_from_ptr_mut};
use crate::slice_from_ptr_mut;
// Utf8CStr types are UTF-8 validated and null terminated strings.
//
// Several Utf8CStr types:
@@ -609,22 +609,6 @@ impl_cstr_buf_write!(
(Utf8CString,)
);
// impl<T: Deref<Target = Utf8CStr>> FsPath for T {}
// impl<T: Deref<Target = Utf8CStr>> FsPathMnt for T {}
macro_rules! impl_fs_path {
($( ($t:ty, $($g:tt)*) )*) => {$(
impl<$($g)*> FsPath for $t {}
impl<$($g)*> FsPathMnt for $t {}
)*}
}
impl_fs_path!(
(&Utf8CStr,)
(Utf8CStrBufRef<'_>,)
(Utf8CStrBufArr<N>, const N: usize)
(Utf8CString,)
);
#[macro_export]
macro_rules! cstr {
($str:expr) => {{