Skip to content
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

Merged
merged 1 commit into from
Feb 16, 2020
Merged

Conversation

abacabadabacaba
Copy link
Collaborator

No description provided.

core/crypto/src/lib.rs Show resolved Hide resolved
macro_rules! unwrap_or_return_false {
($e:expr) => {
match $e {
::std::option::Option::Some(v) => v,
Copy link
Collaborator

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).

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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
Copy link

codecov bot commented Feb 6, 2020

Codecov Report

Merging #2104 into staging will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
core/crypto/src/vrf.rs 100% <100%> (+1.94%) ⬆️
core/crypto/src/util.rs 100% <100%> (ø)
chain/chunks/src/types.rs 0% <0%> (-25%) ⬇️
core/primitives/src/types.rs 94.11% <0%> (-3.53%) ⬇️
chain/network/src/test_utils.rs 89.36% <0%> (-3.2%) ⬇️
chain/client/src/sync.rs 86.43% <0%> (-1.49%) ⬇️
chain/client/src/client.rs 93.43% <0%> (-1%) ⬇️
chain/client/tests/chunks_management.rs 96.23% <0%> (-0.84%) ⬇️
chain/chain/src/validate.rs 90.14% <0%> (-0.37%) ⬇️
runtime/runtime/src/state_viewer.rs 92.35% <0%> (-0.24%) ⬇️
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 500e91f...2056d2b. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants