1
Fork 0

Make runtime function return size_t

It returns sizeof(dirent_t), so I'm not sure why its return type is int.
It's only used once, and that usage immediately casts it to usize.
This commit is contained in:
Michael McConville 2015-12-17 21:04:54 -05:00
parent 9687a8a969
commit 5f59e1c8f9
2 changed files with 3 additions and 3 deletions

View file

@ -127,11 +127,11 @@ impl Iterator for ReadDir {
fn next(&mut self) -> Option<io::Result<DirEntry>> {
extern {
fn rust_dirent_t_size() -> c_int;
fn rust_dirent_t_size() -> size_t;
}
let mut buf: Vec<u8> = Vec::with_capacity(unsafe {
rust_dirent_t_size() as usize
rust_dirent_t_size()
});
let ptr = buf.as_mut_ptr() as *mut libc::dirent;