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:
parent
9687a8a969
commit
5f59e1c8f9
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue