Skip to content

Commit f01d924

Browse files
Remove test function from doc sample
1 parent 02187bc commit f01d924

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/libproc/proc_pid.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,15 @@ pub fn name(pid: i32) -> Result<String, String> {
318318
/// use libproc::libproc::proc_pid::{listpidinfo, pidinfo};
319319
/// use libproc::libproc::task_info::{TaskAllInfo};
320320
/// use libproc::libproc::file_info::{ListFDs, ProcFDType};
321+
/// use std::process;
321322
///
322-
/// fn listpidinfo_test() {
323-
/// use std::process;
324-
/// let pid = process::id() as i32;
323+
/// let pid = process::id() as i32;
325324
///
326-
/// if let Ok(info) = pidinfo::<TaskAllInfo>(pid, 0) {
327-
/// if let Ok(fds) = listpidinfo::<ListFDs>(pid, info.pbsd.pbi_nfiles as usize) {
328-
/// for fd in &fds {
329-
/// let fd_type = ProcFDType::from(fd.proc_fdtype);
330-
/// println!("File Descriptor: {}, Type: {:?}", fd.proc_fd, fd_type);
331-
/// }
325+
/// if let Ok(info) = pidinfo::<TaskAllInfo>(pid, 0) {
326+
/// if let Ok(fds) = listpidinfo::<ListFDs>(pid, info.pbsd.pbi_nfiles as usize) {
327+
/// for fd in &fds {
328+
/// let fd_type = ProcFDType::from(fd.proc_fdtype);
329+
/// println!("File Descriptor: {}, Type: {:?}", fd.proc_fd, fd_type);
332330
/// }
333331
/// }
334332
/// }

0 commit comments

Comments
 (0)