Skip to content

Rename WASI's is_character_device to is_char_device. #90835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/std/src/os/wasi/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,18 +444,22 @@ pub trait FileTypeExt {
/// Returns `true` if this file type is a block device.
fn is_block_device(&self) -> bool;
/// Returns `true` if this file type is a character device.
fn is_character_device(&self) -> bool;
fn is_char_device(&self) -> bool;
/// Returns `true` if this file type is a socket datagram.
fn is_socket_dgram(&self) -> bool;
/// Returns `true` if this file type is a socket stream.
fn is_socket_stream(&self) -> bool;
/// Returns `true` if this file type is any type of socket.
fn is_socket(&self) -> bool {
self.is_socket_stream() || self.is_socket_dgram()
}
}

impl FileTypeExt for fs::FileType {
fn is_block_device(&self) -> bool {
self.as_inner().bits() == wasi::FILETYPE_BLOCK_DEVICE
}
fn is_character_device(&self) -> bool {
fn is_char_device(&self) -> bool {
self.as_inner().bits() == wasi::FILETYPE_CHARACTER_DEVICE
}
fn is_socket_dgram(&self) -> bool {
Expand Down