Replace full slice notation with index calls
This commit is contained in:
parent
918255ef8c
commit
f7ff37e4c5
225 changed files with 2166 additions and 2139 deletions
|
|
@ -36,7 +36,7 @@ const BUF_BYTES : uint = 2048u;
|
|||
pub fn truncate_utf16_at_nul<'a>(v: &'a [u16]) -> &'a [u16] {
|
||||
match v.iter().position(|c| *c == 0) {
|
||||
// don't include the 0
|
||||
Some(i) => v[..i],
|
||||
Some(i) => v.index(&(0..i)),
|
||||
None => v
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ impl UnixStream {
|
|||
}
|
||||
let ret = unsafe {
|
||||
libc::WriteFile(self.handle(),
|
||||
buf[offset..].as_ptr() as libc::LPVOID,
|
||||
buf.index(&(offset..)).as_ptr() as libc::LPVOID,
|
||||
(buf.len() - offset) as libc::DWORD,
|
||||
&mut bytes_written,
|
||||
&mut overlapped)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue