Skip to content

Remove the implementations of std::ops::Not #656

@dtolnay

Description

@dtolnay

From what I can tell, the only reason these exists is to be used in the implementation of Sub and SubAssign.

impl<T: Into<Ready>> ops::Sub<T> for Ready {
    type Output = Ready;

    fn sub(self, other: T) -> Ready {
        Ready(self.0 & !other.into().0)
    }
}

impl<T: Into<Ready>> ops::SubAssign<T> for Ready {
    fn sub_assign(&mut self, other: T) {
        self.0 &= !other.into().0;
    }
}

Other than in Sub, it never makes sense to apply Not to a Ready. You would never call Poll::register and pass the Not of a Ready, for example. Let's reimplement Sub in a different way and remove the semantically meaningless Not operation.

Applies to Ready, UnixReady, FuchsiaReady, and PollOpt.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions