@@ -143,7 +143,6 @@ extern {
143143 fn proc_libversion ( major : * mut c_int , minor : * mut c_int ) -> c_int ;
144144 fn proc_pidpath ( pid : c_int , buffer : * mut c_void , buffersize : u32 ) -> c_int ;
145145 fn proc_regionfilename ( pid : c_int , address : u64 , buffer : * mut c_void , buffersize : u32 ) -> c_int ;
146-
147146}
148147
149148/// Returns the PIDs of the active processes that match the ProcType passed in
@@ -211,7 +210,7 @@ pub fn listpids(proc_types: ProcType) -> Result<Vec<u32>, String> {
211210 }
212211}
213212
214- // proc_listpidspath
213+ // listpidspath
215214// Search through the current processes looking for open file references which match
216215// a specified path or volume.
217216//
@@ -229,7 +228,7 @@ pub fn listpids(proc_types: ProcType) -> Result<Vec<u32>, String> {
229228// @result the number of bytes of data returned in the provided buffer;
230229// -1 if an error was encountered;
231230#[ cfg( target_os = "macos" ) ]
232- pub fn listpidspath ( proc_types : ProcType , path : String ) -> Result < Vec < u32 > , String > {
231+ pub fn listpidspath ( proc_types : ProcType , path : & str ) -> Result < Vec < u32 > , String > {
233232 let buffer_size = unsafe {
234233 proc_listpidspath ( proc_types as u32 , 0 , path. as_ptr ( ) as * const c_char , 0 , ptr:: null_mut ( ) , 0 )
235234 } ;
@@ -745,7 +744,7 @@ mod test {
745744 #[ test]
746745 #[ cfg( target_os = "macos" ) ]
747746 fn listpidspath_test ( ) {
748- let pids = super :: listpidspath ( ProcType :: ProcAllPIDS , "/" . into ( ) ) . unwrap ( ) ;
747+ let pids = super :: listpidspath ( ProcType :: ProcAllPIDS , "/" ) . unwrap ( ) ;
749748 assert ! ( pids. len( ) > 1 ) ;
750749 }
751750}
0 commit comments