-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add operators &, |, ! for Tracer<Bit> #88
Add operators &, |, ! for Tracer<Bit> #88
Conversation
impl<'a> Tracer<'a, Bit> { | ||
/// Returns the single node associated with the bit. | ||
pub fn node(&self) -> Node<Feed> { | ||
self.to_inner().nodes()[0] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that .to_inner().nodes()[0]
could be replaced with .node()
, otherwise repeated many times now.
|
||
drop(state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RefMut
only lives to the end of the method and the state isn't used before then, so there's no need to explicitly drop it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
@voltrevo looks like you just need to run fmt |
Done :) |
Enables you to write eg:
I wanted these ops when I made a circuit for Rock Paper Scissors Lizard Spock.