diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2017-12-11 04:05:12 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2017-12-11 04:05:12 +0000 |
commit | b957a7a801635cbf5b7b4f8bae67108a7117e0fd (patch) | |
tree | 31f5a5b09bf5cfae8e2ba457973281974200cf8d | |
parent | e1ce3619bd3013d345a36d0a7b908c243788471e (diff) | |
parent | 133e3501bca30edbc747bc8e83aca86f0908a8d2 (diff) | |
download | nix-b957a7a801635cbf5b7b4f8bae67108a7117e0fd.zip |
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.
-rw-r--r-- | src/sys/aio.rs | 1 | ||||
-rw-r--r-- | src/sys/mman.rs | 3 | ||||
-rw-r--r-- | src/sys/quota.rs | 4 | ||||
-rw-r--r-- | src/sys/select.rs | 1 | ||||
-rw-r--r-- | src/unistd.rs | 34 |
5 files changed, 35 insertions, 8 deletions
diff --git a/src/sys/aio.rs b/src/sys/aio.rs index fbae4443..909b59d7 100644 --- a/src/sys/aio.rs +++ b/src/sys/aio.rs @@ -98,6 +98,7 @@ impl<'a> AioCb<'a> { /// Constructs a new `AioCb` with no associated buffer. /// /// The resulting `AioCb` structure is suitable for use with `AioCb::fsync`. + /// /// * `fd` File descriptor. Required for all aio functions. /// * `prio` If POSIX Prioritized IO is supported, then the operation will /// be prioritized at the process's priority level minus `prio` diff --git a/src/sys/mman.rs b/src/sys/mman.rs index a32cd54a..65f6c59d 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -101,8 +101,7 @@ libc_bitflags!{ libc_enum!{ /// Usage information for a range of memory to allow for performance optimizations by the kernel. /// - /// Used by [`madvise`]. - /// [`madvise`]: ./fn.madvise.html + /// Used by [`madvise`](./fn.madvise.html). #[repr(i32)] pub enum MmapAdvise { /// No further special treatment. This is the default. diff --git a/src/sys/quota.rs b/src/sys/quota.rs index abe114f0..a85d9e30 100644 --- a/src/sys/quota.rs +++ b/src/sys/quota.rs @@ -60,11 +60,11 @@ libc_enum!{ QFMT_VFS_OLD, /// Use the standard VFS v0 quota format. /// - /// Handles 32-bit UIDs/GIDs and quota limits up to 2^42 bytes/2^32 inodes. + /// Handles 32-bit UIDs/GIDs and quota limits up to 2<sup>32</sup> bytes/2<sup>32</sup> inodes. QFMT_VFS_V0, /// Use the VFS v1 quota format. /// - /// Handles 32-bit UIDs/GIDs and quota limits of 2^64 bytes/2^64 inodes. + /// Handles 32-bit UIDs/GIDs and quota limits of 2<sup>64</sup> bytes/2<sup>64</sup> inodes. QFMT_VFS_V1, } } diff --git a/src/sys/select.rs b/src/sys/select.rs index 9a429103..6fe176ae 100644 --- a/src/sys/select.rs +++ b/src/sys/select.rs @@ -88,6 +88,7 @@ impl FdSet { /// # References /// /// [select(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html) +/// /// [`FdSet::highest`]: struct.FdSet.html#method.highest pub fn select<'a, N, R, W, E, T>(nfds: N, readfds: R, diff --git a/src/unistd.rs b/src/unistd.rs index cb2a29f6..f35eab9d 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -815,6 +815,7 @@ pub fn write(fd: RawFd, buf: &[u8]) -> Result<usize> { } /// Directive that tells [`lseek`] and [`lseek64`] what the offset is relative to. +/// /// [`lseek`]: ./fn.lseek.html /// [`lseek64`]: ./fn.lseek64.html #[repr(i32)] @@ -847,7 +848,7 @@ pub enum Whence { /// Move the read/write file offset. /// -/// See also [lseek(2)(http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html) +/// See also [lseek(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html) pub fn lseek(fd: RawFd, offset: libc::off_t, whence: Whence) -> Result<libc::off_t> { let res = unsafe { libc::lseek(fd, offset, whence as i32) }; @@ -1143,12 +1144,24 @@ pub fn getgroups() -> Result<Vec<Gid>> { /// specific user and group. For example, given the user `www-data` with UID /// `33` and the group `backup` with the GID `34`, one could switch the user as /// follows: -/// ``` +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box<Error>> { /// let uid = Uid::from_raw(33); /// let gid = Gid::from_raw(34); /// setgroups(&[gid])?; /// setgid(gid)?; /// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # fn main() { +/// # try_main().unwrap(); +/// # } /// ``` #[cfg(not(any(target_os = "ios", target_os = "macos")))] pub fn setgroups(groups: &[Gid]) -> Result<()> { @@ -1264,13 +1277,26 @@ pub fn getgrouplist(user: &CStr, group: Gid) -> Result<Vec<Gid>> { /// UID and GID for the user in the system's password database (usually found /// in `/etc/passwd`). If the `www-data` user's UID and GID were `33` and `33`, /// respectively, one could switch the user as follows: -/// ``` +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use std::ffi::CString; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box<Error>> { /// let user = CString::new("www-data").unwrap(); /// let uid = Uid::from_raw(33); /// let gid = Gid::from_raw(33); /// initgroups(&user, gid)?; /// setgid(gid)?; /// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # fn main() { +/// # try_main().unwrap(); +/// # } /// ``` #[cfg(not(any(target_os = "ios", target_os = "macos")))] pub fn initgroups(user: &CStr, group: Gid) -> Result<()> { @@ -1299,7 +1325,7 @@ pub fn pause() -> Result<()> { /// Suspend execution for an interval of time /// -/// See also [sleep(2)(http://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05) +/// See also [sleep(2)](http://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05) // Per POSIX, does not fail #[inline] pub fn sleep(seconds: libc::c_uint) -> c_uint { |