Skip to content

Commit d4740e5

Browse files
committed
Fix clippy lints
1 parent 37dda5d commit d4740e5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ fn handle_input_io(spec: InputSpecification) -> Result<(Option<Fd>, Fd), Error>
123123
let file = file.into_raw_fd();
124124
Ok((None, file))
125125
}
126-
InputSpecificationData::Null => Ok((None, -1 as Fd)),
126+
InputSpecificationData::Null => Ok((None, -1)),
127127
}
128128
}
129129

130130
fn handle_output_io(spec: OutputSpecification) -> Result<(Option<Fd>, Fd), Error> {
131131
match spec.0 {
132-
OutputSpecificationData::Null => Ok((None, -1 as Fd)),
132+
OutputSpecificationData::Null => Ok((None, -1)),
133133
OutputSpecificationData::Handle(rh) => Ok((None, rh as Fd)),
134134
OutputSpecificationData::Pipe => {
135135
let mut h_read = 0;

src/linux/pipe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl io::Write for LinuxWritePipe {
7474

7575
pub(crate) fn setup_pipe(read_end: &mut Fd, write_end: &mut Fd) -> Result<(), crate::linux::Error> {
7676
unsafe {
77-
let mut ends = [0 as Fd; 2];
77+
let mut ends = [0; 2];
7878
let ret = libc::pipe2(ends.as_mut_ptr(), libc::O_CLOEXEC);
7979
if ret == -1 {
8080
err_exit("pipe");

src/linux/zygote.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn do_exec(mut arg: DoExecArg) -> ! {
170170
if -1 == libc::fcntl(fd, libc::F_SETFD, libc::FD_CLOEXEC) {
171171
let fd_info_path = format!("/proc/self/fd/{}", fd);
172172
let fd_info_path = CString::new(fd_info_path.as_str()).unwrap();
173-
let mut fd_info = [0 as c_char; 4096];
173+
let mut fd_info = [0; 4096];
174174
libc::readlink(fd_info_path.as_ptr(), fd_info.as_mut_ptr(), 4096);
175175
let fd_info = CString::from_raw(fd_info.as_mut_ptr());
176176
let fd_info = fd_info.to_str().unwrap();
@@ -420,7 +420,7 @@ fn start_zygote_caller(
420420
let mut logger = crate::linux::util::strace_logger();
421421
write!(logger, "sandbox {}: thread A (main)", &jail_options.jail_id).unwrap();
422422

423-
let mut zygote_pid_bytes = [0 as u8; 4];
423+
let mut zygote_pid_bytes = [0; 4];
424424

425425
// Wait until zygote is ready.
426426
// Zygote is ready when zygote launcher returns it's pid

0 commit comments

Comments
 (0)