Skip to content

Commit

Permalink
Auto merge of #350 - llogiq:clippy, r=posborne
Browse files Browse the repository at this point in the history
fixed a few clippy warnings

Just a few style nits. Hope it'll be useful anyway 😄
  • Loading branch information
homu committed Apr 14, 2016
2 parents abc7b27 + 1c802a1 commit b7c2f88
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ mod os {
static VERS_2_6_28: usize = 4;
static VERS_3: usize = 5;

#[inline]
fn digit(dst: &mut usize, b: u8) {
*dst *= 10;
*dst += (b - b'0') as usize;
}

fn parse_kernel_version() -> usize {
let u = uname();

#[inline]
fn digit(dst: &mut usize, b: u8) {
*dst *= 10;
*dst += (b - b'0') as usize;
}

let mut curr: usize = 0;
let mut major: usize = 0;
let mut minor: usize = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/mqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ pub fn mq_getattr(mqd: MQd) -> Result<MqAttr> {
Ok(attr)
}

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

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

/// Convenience function.
/// Removes O_NONBLOCK attribute for a given message queue descriptor
/// Removes `O_NONBLOCK` attribute for a given message queue descriptor
/// Returns the old attributes
pub fn mq_remove_nonblock(mqd: MQd) -> Result<(MqAttr)> {
let oldattr = try!(mq_getattr(mqd));
Expand Down
2 changes: 1 addition & 1 deletion src/sys/ptrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn ptrace_other(request: ptrace::PtraceRequest, pid: pid_t, addr: *mut c_void, d
Errno::result(unsafe { ffi::ptrace(request, pid, addr, data) }).map(|_| 0)
}

/// Set options, as with ptrace(PTRACE_SETOPTIONS,...).
/// Set options, as with `ptrace(PTRACE_SETOPTIONS,...)`.
pub fn ptrace_setoptions(pid: pid_t, options: ptrace::PtraceOptions) -> Result<()> {
use self::ptrace::*;
use std::ptr;
Expand Down
4 changes: 2 additions & 2 deletions src/sys/socket/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ impl fmt::Display for Ipv6Addr {
*
*/

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

Expand Down
2 changes: 1 addition & 1 deletion src/unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ fn pipe2_setflags(fd1: RawFd, fd2: RawFd, flags: OFlag) -> Result<()> {
Err(e) => {
let _ = close(fd1);
let _ = close(fd2);
return Err(e);
Err(e)
}
}
}
Expand Down

0 comments on commit b7c2f88

Please sign in to comment.