@@ -8,17 +8,16 @@ use std::ffi::{CStr, CString, OsStr};
88use std:: marker:: PhantomData ;
99use std:: os:: raw:: { c_int, c_long, c_short} ;
1010use std:: path:: Path ;
11- use std:: ptr:: NonNull ;
1211use std:: { io, iter, ptr, slice} ;
1312
1413use crate :: errors:: { Error , Result } ;
1514use crate :: os_str_to_c_string;
1615
1716#[ derive( Debug ) ]
1817pub ( crate ) struct FTS {
19- fts : NonNull < fts_sys:: FTS > ,
18+ fts : ptr :: NonNull < fts_sys:: FTS > ,
2019
21- entry : Option < NonNull < fts_sys:: FTSENT > > ,
20+ entry : Option < ptr :: NonNull < fts_sys:: FTSENT > > ,
2221 _phantom_data : PhantomData < fts_sys:: FTSENT > ,
2322}
2423
@@ -52,7 +51,7 @@ impl FTS {
5251 // - `compar` is None.
5352 let fts = unsafe { fts_sys:: fts_open ( path_argv. as_ptr ( ) . cast ( ) , options, None ) } ;
5453
55- let fts = NonNull :: new ( fts)
54+ let fts = ptr :: NonNull :: new ( fts)
5655 . ok_or_else ( || Error :: from_io ( "fts_open()" , io:: Error :: last_os_error ( ) ) ) ?;
5756
5857 Ok ( Self {
@@ -71,7 +70,7 @@ impl FTS {
7170 // pointer assumed to be valid.
7271 let new_entry = unsafe { fts_sys:: fts_read ( self . fts . as_ptr ( ) ) } ;
7372
74- self . entry = NonNull :: new ( new_entry) ;
73+ self . entry = ptr :: NonNull :: new ( new_entry) ;
7574 if self . entry . is_none ( ) {
7675 let r = io:: Error :: last_os_error ( ) ;
7776 if let Some ( 0 ) = r. raw_os_error ( ) {
@@ -110,14 +109,14 @@ impl Drop for FTS {
110109
111110#[ derive( Debug ) ]
112111pub ( crate ) struct EntryRef < ' fts > {
113- pub ( crate ) pointer : NonNull < fts_sys:: FTSENT > ,
112+ pub ( crate ) pointer : ptr :: NonNull < fts_sys:: FTSENT > ,
114113
115114 _fts : PhantomData < & ' fts FTS > ,
116115 _phantom_data : PhantomData < fts_sys:: FTSENT > ,
117116}
118117
119118impl < ' fts > EntryRef < ' fts > {
120- fn new ( _fts : & ' fts FTS , entry : NonNull < fts_sys:: FTSENT > ) -> Self {
119+ fn new ( _fts : & ' fts FTS , entry : ptr :: NonNull < fts_sys:: FTSENT > ) -> Self {
121120 Self {
122121 pointer : entry,
123122 _fts : PhantomData ,
@@ -161,7 +160,7 @@ impl<'fts> EntryRef<'fts> {
161160 return None ;
162161 }
163162
164- NonNull :: new ( entry. fts_path )
163+ ptr :: NonNull :: new ( entry. fts_path )
165164 . map ( |path_ptr| {
166165 let path_size = usize:: from ( entry. fts_pathlen ) . saturating_add ( 1 ) ;
167166
@@ -174,7 +173,7 @@ impl<'fts> EntryRef<'fts> {
174173 }
175174
176175 pub ( crate ) fn access_path ( & self ) -> Option < & Path > {
177- NonNull :: new ( self . as_ref ( ) . fts_accpath )
176+ ptr :: NonNull :: new ( self . as_ref ( ) . fts_accpath )
178177 . map ( |path_ptr| {
179178 // SAFETY: `entry.fts_accpath` is a non-null pointer that is assumed to be valid.
180179 unsafe { CStr :: from_ptr ( path_ptr. as_ptr ( ) ) }
@@ -184,7 +183,7 @@ impl<'fts> EntryRef<'fts> {
184183 }
185184
186185 pub ( crate ) fn stat ( & self ) -> Option < & libc:: stat > {
187- NonNull :: new ( self . as_ref ( ) . fts_statp ) . map ( |stat_ptr| {
186+ ptr :: NonNull :: new ( self . as_ref ( ) . fts_statp ) . map ( |stat_ptr| {
188187 // SAFETY: `entry.fts_statp` is a non-null pointer that is assumed to be valid.
189188 unsafe { stat_ptr. as_ref ( ) }
190189 } )
0 commit comments