Skip to content

PollFd::revents should not return None #2723

Open

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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