Skip to content

Commit b957a7a

Browse files
committed
Merge #806
806: Cleanup all doc warnings r=asomers a=Susurrus With the impending switch to Pulldown as the default doc generator, warnings have been enabled for incompatible syntax. This fixes all of said warnings.
2 parents e1ce361 + 133e350 commit b957a7a

File tree

5 files changed

+35
-8
lines changed

5 files changed

+35
-8
lines changed

src/sys/aio.rs

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ impl<'a> AioCb<'a> {
9898
/// Constructs a new `AioCb` with no associated buffer.
9999
///
100100
/// The resulting `AioCb` structure is suitable for use with `AioCb::fsync`.
101+
///
101102
/// * `fd` File descriptor. Required for all aio functions.
102103
/// * `prio` If POSIX Prioritized IO is supported, then the operation will
103104
/// be prioritized at the process's priority level minus `prio`

src/sys/mman.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ libc_bitflags!{
101101
libc_enum!{
102102
/// Usage information for a range of memory to allow for performance optimizations by the kernel.
103103
///
104-
/// Used by [`madvise`].
105-
/// [`madvise`]: ./fn.madvise.html
104+
/// Used by [`madvise`](./fn.madvise.html).
106105
#[repr(i32)]
107106
pub enum MmapAdvise {
108107
/// No further special treatment. This is the default.

src/sys/quota.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ libc_enum!{
6060
QFMT_VFS_OLD,
6161
/// Use the standard VFS v0 quota format.
6262
///
63-
/// Handles 32-bit UIDs/GIDs and quota limits up to 2^42 bytes/2^32 inodes.
63+
/// Handles 32-bit UIDs/GIDs and quota limits up to 2<sup>32</sup> bytes/2<sup>32</sup> inodes.
6464
QFMT_VFS_V0,
6565
/// Use the VFS v1 quota format.
6666
///
67-
/// Handles 32-bit UIDs/GIDs and quota limits of 2^64 bytes/2^64 inodes.
67+
/// Handles 32-bit UIDs/GIDs and quota limits of 2<sup>64</sup> bytes/2<sup>64</sup> inodes.
6868
QFMT_VFS_V1,
6969
}
7070
}

src/sys/select.rs

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ impl FdSet {
8888
/// # References
8989
///
9090
/// [select(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html)
91+
///
9192
/// [`FdSet::highest`]: struct.FdSet.html#method.highest
9293
pub fn select<'a, N, R, W, E, T>(nfds: N,
9394
readfds: R,

src/unistd.rs

+30-4
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,7 @@ pub fn write(fd: RawFd, buf: &[u8]) -> Result<usize> {
815815
}
816816

817817
/// Directive that tells [`lseek`] and [`lseek64`] what the offset is relative to.
818+
///
818819
/// [`lseek`]: ./fn.lseek.html
819820
/// [`lseek64`]: ./fn.lseek64.html
820821
#[repr(i32)]
@@ -847,7 +848,7 @@ pub enum Whence {
847848

848849
/// Move the read/write file offset.
849850
///
850-
/// See also [lseek(2)(http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html)
851+
/// See also [lseek(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html)
851852
pub fn lseek(fd: RawFd, offset: libc::off_t, whence: Whence) -> Result<libc::off_t> {
852853
let res = unsafe { libc::lseek(fd, offset, whence as i32) };
853854

@@ -1143,12 +1144,24 @@ pub fn getgroups() -> Result<Vec<Gid>> {
11431144
/// specific user and group. For example, given the user `www-data` with UID
11441145
/// `33` and the group `backup` with the GID `34`, one could switch the user as
11451146
/// follows:
1146-
/// ```
1147+
///
1148+
/// ```rust,no_run
1149+
/// # use std::error::Error;
1150+
/// # use nix::unistd::*;
1151+
/// #
1152+
/// # fn try_main() -> Result<(), Box<Error>> {
11471153
/// let uid = Uid::from_raw(33);
11481154
/// let gid = Gid::from_raw(34);
11491155
/// setgroups(&[gid])?;
11501156
/// setgid(gid)?;
11511157
/// setuid(uid)?;
1158+
/// #
1159+
/// # Ok(())
1160+
/// # }
1161+
/// #
1162+
/// # fn main() {
1163+
/// # try_main().unwrap();
1164+
/// # }
11521165
/// ```
11531166
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
11541167
pub fn setgroups(groups: &[Gid]) -> Result<()> {
@@ -1264,13 +1277,26 @@ pub fn getgrouplist(user: &CStr, group: Gid) -> Result<Vec<Gid>> {
12641277
/// UID and GID for the user in the system's password database (usually found
12651278
/// in `/etc/passwd`). If the `www-data` user's UID and GID were `33` and `33`,
12661279
/// respectively, one could switch the user as follows:
1267-
/// ```
1280+
///
1281+
/// ```rust,no_run
1282+
/// # use std::error::Error;
1283+
/// # use std::ffi::CString;
1284+
/// # use nix::unistd::*;
1285+
/// #
1286+
/// # fn try_main() -> Result<(), Box<Error>> {
12681287
/// let user = CString::new("www-data").unwrap();
12691288
/// let uid = Uid::from_raw(33);
12701289
/// let gid = Gid::from_raw(33);
12711290
/// initgroups(&user, gid)?;
12721291
/// setgid(gid)?;
12731292
/// setuid(uid)?;
1293+
/// #
1294+
/// # Ok(())
1295+
/// # }
1296+
/// #
1297+
/// # fn main() {
1298+
/// # try_main().unwrap();
1299+
/// # }
12741300
/// ```
12751301
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
12761302
pub fn initgroups(user: &CStr, group: Gid) -> Result<()> {
@@ -1299,7 +1325,7 @@ pub fn pause() -> Result<()> {
12991325

13001326
/// Suspend execution for an interval of time
13011327
///
1302-
/// See also [sleep(2)(http://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05)
1328+
/// See also [sleep(2)](http://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05)
13031329
// Per POSIX, does not fail
13041330
#[inline]
13051331
pub fn sleep(seconds: libc::c_uint) -> c_uint {

0 commit comments

Comments
 (0)