Skip to content

Commit c4c4511

Browse files
authored
Miscellaneous documentation fixes. (#1142)
Fix a typo, fix some warnings from the new clippy::too_long_first_doc_paragraph, and tidy up.
1 parent b978851 commit c4c4511

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

src/fs/inotify.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
//! use std::mem::MaybeUninit;
99
//!
1010
//! # fn test() -> io::Result<()> {
11-
//! // Creeate an inotify object. In this example, we use `NONBLOCK` so that
12-
//! // the reader fails with `WOULDBLOCk` when no events are ready. Otherwise
13-
//! // it will block until at least one event is ready.
11+
//! // Create an inotify object. In this example, we use `NONBLOCK` so that the
12+
//! // reader fails with `WOULDBLOCk` when no events are ready. Otherwise it
13+
//! // will block until at least one event is ready.
1414
//! let inotify = inotify::init(inotify::CreateFlags::NONBLOCK)?;
1515
//!
1616
//! // Add a directory to watch.
@@ -20,7 +20,7 @@
2020
//! inotify::WatchFlags::ALL_EVENTS,
2121
//! )?;
2222
//!
23-
//! // Generate some events in the watched directory...
23+
//! // Generate some events in the watched directory
2424
//!
2525
//! // Loop over pending events.
2626
//! let mut buf = [MaybeUninit::uninit(); 512];
@@ -33,7 +33,7 @@
3333
//! Ok(entry) => entry,
3434
//! };
3535
//!
36-
//! // Use `entry`...
36+
//! // Use `entry`
3737
//! }
3838
//!
3939
//! # Ok(())

src/net/types.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,10 @@ const fn new_raw_protocol(u: u32) -> RawProtocol {
643643
}
644644

645645
/// `IPPROTO_*` and other constants for use with [`socket`], [`socket_with`],
646-
/// and [`socketpair`] when a nondefault value is desired. See the [`ipproto`],
647-
/// [`sysproto`], and [`netlink`] modules for possible values.
646+
/// and [`socketpair`] when a nondefault value is desired.
647+
///
648+
/// See the [`ipproto`], [`sysproto`], and [`netlink`] modules for possible
649+
/// values.
648650
///
649651
/// For the default values, such as `IPPROTO_IP` or `NETLINK_ROUTE`, pass
650652
/// `None` as the `protocol` argument in these functions.

src/process/prctl.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ pub fn dumpable_behavior() -> io::Result<DumpableBehavior> {
110110

111111
const PR_SET_DUMPABLE: c_int = 4;
112112

113-
/// Set the state of the `dumpable` attribute, which determines whether the
114-
/// process can be traced and whether core dumps are produced for the calling
115-
/// process upon delivery of a signal whose default behavior is to produce a
116-
/// core dump.
113+
/// Set the state of the `dumpable` attribute.
114+
///
115+
/// This attribute determines whether the process can be traced and whether
116+
/// core dumps are produced for the calling process upon delivery of a signal
117+
/// whose default behavior is to produce a core dump.
117118
///
118119
/// A similar function with the same name is available on FreeBSD (as part of
119120
/// the `procctl` interface), but it has an extra argument which allows to

src/shm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! // A type describing the data to be shared.
1414
//! #[repr(C)]
1515
//! struct MyBufferType {
16-
//! // ...
16+
//! //
1717
//! }
1818
//!
1919
//! // Create the shared memory object.
@@ -43,7 +43,7 @@
4343
//! )?
4444
//! };
4545
//!
46-
//! // Use `ptr`...
46+
//! // Use `ptr`
4747
//!
4848
//! // Remove the shared memory object name.
4949
//! shm::unlink(shm_path)?;

0 commit comments

Comments
 (0)