Skip to content

Commit e69a02e

Browse files
committed
Remove Initializer, unsafe feature, compiles
(rust-lang/rust#42788)
1 parent 083d172 commit e69a02e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/fd.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
mod tests;
33

44
use std::cmp;
5-
use std::io::{self, Initializer, IoSlice, IoSliceMut, Read};
5+
use std::io::{self, IoSlice, IoSliceMut, Read};
66
use std::mem;
77
use crate::cvt::cvt;
88
use crate::sys_common::AsInner;
@@ -63,7 +63,7 @@ impl FileDesc {
6363
pub fn new(fd: c_int) -> FileDesc {
6464
assert_ne!(fd, -1i32);
6565
// 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)
66-
unsafe { FileDesc { fd } }
66+
FileDesc { fd }
6767
}
6868

6969
pub fn raw(&self) -> c_int {
@@ -270,11 +270,6 @@ impl<'a> Read for &'a FileDesc {
270270
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
271271
(**self).read(buf)
272272
}
273-
274-
#[inline]
275-
unsafe fn initializer(&self) -> Initializer {
276-
Initializer::nop()
277-
}
278273
}
279274

280275
impl AsInner<c_int> for FileDesc {

0 commit comments

Comments
 (0)