Skip to content

Commit b7c2f88

Browse files
committed
Auto merge of #350 - llogiq:clippy, r=posborne
fixed a few clippy warnings Just a few style nits. Hope it'll be useful anyway 😄
2 parents abc7b27 + 1c802a1 commit b7c2f88

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/features.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ mod os {
1515
static VERS_2_6_28: usize = 4;
1616
static VERS_3: usize = 5;
1717

18+
#[inline]
19+
fn digit(dst: &mut usize, b: u8) {
20+
*dst *= 10;
21+
*dst += (b - b'0') as usize;
22+
}
23+
1824
fn parse_kernel_version() -> usize {
1925
let u = uname();
2026

21-
#[inline]
22-
fn digit(dst: &mut usize, b: u8) {
23-
*dst *= 10;
24-
*dst += (b - b'0') as usize;
25-
}
26-
2727
let mut curr: usize = 0;
2828
let mut major: usize = 0;
2929
let mut minor: usize = 0;

src/mqueue.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ pub fn mq_getattr(mqd: MQd) -> Result<MqAttr> {
114114
Ok(attr)
115115
}
116116

117-
/// Set the attributes of the message queue. Only O_NONBLOCK can be set, everything else will be ignored
117+
/// Set the attributes of the message queue. Only `O_NONBLOCK` can be set, everything else will be ignored
118118
/// Returns the old attributes
119-
/// It is recommend to use the mq_set_nonblock() and mq_remove_nonblock() convenience functions as they are easier to use
119+
/// It is recommend to use the `mq_set_nonblock()` and `mq_remove_nonblock()` convenience functions as they are easier to use
120120
///
121121
/// [Further reading](http://man7.org/linux/man-pages/man3/mq_setattr.3.html)
122122
pub fn mq_setattr(mqd: MQd, newattr: &MqAttr) -> Result<MqAttr> {
@@ -127,7 +127,7 @@ pub fn mq_setattr(mqd: MQd, newattr: &MqAttr) -> Result<MqAttr> {
127127
}
128128

129129
/// Convenience function.
130-
/// Sets the O_NONBLOCK attribute for a given message queue descriptor
130+
/// Sets the `O_NONBLOCK` attribute for a given message queue descriptor
131131
/// Returns the old attributes
132132
pub fn mq_set_nonblock(mqd: MQd) -> Result<(MqAttr)> {
133133
let oldattr = try!(mq_getattr(mqd));
@@ -136,7 +136,7 @@ pub fn mq_set_nonblock(mqd: MQd) -> Result<(MqAttr)> {
136136
}
137137

138138
/// Convenience function.
139-
/// Removes O_NONBLOCK attribute for a given message queue descriptor
139+
/// Removes `O_NONBLOCK` attribute for a given message queue descriptor
140140
/// Returns the old attributes
141141
pub fn mq_remove_nonblock(mqd: MQd) -> Result<(MqAttr)> {
142142
let oldattr = try!(mq_getattr(mqd));

src/sys/ptrace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn ptrace_other(request: ptrace::PtraceRequest, pid: pid_t, addr: *mut c_void, d
9595
Errno::result(unsafe { ffi::ptrace(request, pid, addr, data) }).map(|_| 0)
9696
}
9797

98-
/// Set options, as with ptrace(PTRACE_SETOPTIONS,...).
98+
/// Set options, as with `ptrace(PTRACE_SETOPTIONS,...)`.
9999
pub fn ptrace_setoptions(pid: pid_t, options: ptrace::PtraceOptions) -> Result<()> {
100100
use self::ptrace::*;
101101
use std::ptr;

src/sys/socket/addr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ impl fmt::Display for Ipv6Addr {
348348
*
349349
*/
350350

351-
/// A wrapper around sockaddr_un. We track the length of sun_path,
351+
/// A wrapper around `sockaddr_un`. We track the length of `sun_path`,
352352
/// because it may not be null-terminated (unconnected and abstract
353353
/// sockets). Note that the actual sockaddr length is greater by
354-
/// size_of::<sa_family_t>().
354+
/// `size_of::<sa_family_t>()`.
355355
#[derive(Copy)]
356356
pub struct UnixAddr(pub libc::sockaddr_un, pub usize);
357357

src/unistd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ fn pipe2_setflags(fd1: RawFd, fd2: RawFd, flags: OFlag) -> Result<()> {
255255
Err(e) => {
256256
let _ = close(fd1);
257257
let _ = close(fd2);
258-
return Err(e);
258+
Err(e)
259259
}
260260
}
261261
}

0 commit comments

Comments
 (0)