-
Notifications
You must be signed in to change notification settings - Fork 664
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 some utilities for later crypto use. #2104
Conversation
macro_rules! unwrap_or_return_false { | ||
($e:expr) => { | ||
match $e { | ||
::std::option::Option::Some(v) => v, |
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.
this is also outdated syntax. ::
is not necessary. Also Option
is imported in prelude by default so it suffices to write Some(v)
.
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.
Well, this will make it always use Some
from std
, rather than whatever Some
is in scope at macro invocation site. Although it is probably not the best idea to define e.g. a local variable named Some
.
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.
Okay then I suggest using std::option::Option::Some
.
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.
Then it will break if there is something named std
in scope. Leading ::
forces the following identifier to be interpreted as a library name.
Codecov Report
@@ Coverage Diff @@
## staging #2104 +/- ##
===========================================
+ Coverage 86.92% 86.92% +<.01%
===========================================
Files 179 180 +1
Lines 34271 34273 +2
===========================================
+ Hits 29791 29793 +2
Misses 4480 4480
Continue to review full report at Codecov.
|
34fe463
to
2056d2b
Compare
No description provided.