Skip to content

Commit 1f36802

Browse files
committed
Use new slicing syntax
1 parent 6620474 commit 1f36802

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wrapper.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl INotify {
126126
-1 => {
127127
let error = errno();
128128
if error == EAGAIN as usize || error == EWOULDBLOCK as usize {
129-
return Ok(self.events.as_slice());
129+
return Ok(&self.events[]);
130130
}
131131
else {
132132
return Err(IoError::from_errno(error, true));
@@ -141,7 +141,7 @@ impl INotify {
141141
let mut i = 0;
142142
while i < len {
143143
unsafe {
144-
let slice = buffer.slice_from(i as usize);
144+
let slice = &buffer[i as usize..];
145145

146146
let event = slice.as_ptr() as *const inotify_event;
147147

@@ -165,7 +165,7 @@ impl INotify {
165165
}
166166
}
167167

168-
Ok(self.events.as_slice())
168+
Ok(&self.events[])
169169
}
170170

171171
pub fn close(&self) -> IoResult<()> {

0 commit comments

Comments
 (0)