Skip to content

PollFd::revents should not return None #2723

@stepancheg

Description

@stepancheg

The change is trivial:

-    pub fn revents(&self) -> Option<PollFlags> {
-        PollFlags::from_bits(self.pollfd.revents)
+    pub fn revents(&self) -> PollFlags {
+        PollFlags::from_bits_retain(self.pollfd.revents)
     }

Motivation is that it is hard to handle None on the caller: suppose a flag I need is set, how one is supposed to handle None?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions