Skip to content

Commit

Permalink
Remove Initializer, unsafe feature, compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
iceiix committed Jan 17, 2021
1 parent 083d172 commit e69a02e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mod tests;

use std::cmp;
use std::io::{self, Initializer, IoSlice, IoSliceMut, Read};
use std::io::{self, IoSlice, IoSliceMut, Read};
use std::mem;
use crate::cvt::cvt;
use crate::sys_common::AsInner;
Expand Down Expand Up @@ -63,7 +63,7 @@ impl FileDesc {
pub fn new(fd: c_int) -> FileDesc {
assert_ne!(fd, -1i32);
// SAFETY: we just asserted that the value is in the valid range and isn't `-1` (the only value bigger than `0xFF_FF_FF_FE` unsigned)
unsafe { FileDesc { fd } }
FileDesc { fd }
}

pub fn raw(&self) -> c_int {
Expand Down Expand Up @@ -270,11 +270,6 @@ impl<'a> Read for &'a FileDesc {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
(**self).read(buf)
}

#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
}
}

impl AsInner<c_int> for FileDesc {
Expand Down

0 comments on commit e69a02e

Please sign in to comment.