Skip to content

fixed a few clippy warnings #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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