-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove unnecessary use statements As suggested by clippy remove redundant use statements. * Remove self type parameter Clippy emits: warning: the type of the `self` parameter does not need to be arbitrary As suggested, remove the type parameter. * Allow single char names This is cryptography code, the single char names have meaning. * Do not clone reference Clippy emits: error: using `clone` on a double-reference; this will copy the reference of type `&[u64]` instead of cloning the inner type As suggested, remove the `clone`. * Remove unnecessary calls to clone For types that implement `Copy` its unnecessary to clone them. * Declare bytes_vec as mutable We need a mutable reference to `bytes_vec`, declare it as mutable. * Fix function returns Fix function returns to be idiomatic Rust by: - Do not return the result of a let binding - Do not use `return` for final statement * Use integer literal Clippy emits: warning: casting integer literal to `u8` is unnecessary Use `X_u8` instead of `X as u8`. * Do not cast integer literal as u32 Clippy emits: warning: casting integer literal to `u32` is unnecessary Remove the casts as suggested. * Fix vec! usage Fix usage of `vec!` macro by: - Use `vec!` instead of pushing to a newly created vector. - Do not use vec when creating a slice argument. * Do not manually loop to get loop counter Clippy emits warning: the loop variable `i` is used to index `poly` Use combinators `iter()enumerate().skip(1)` as suggested. * Allow unit error The `verify` method only needs to show it err'ed. No real need for a custom `Error` so instruct Clippy to allow return of unit error. * Remove unnecessary references As suggested by Clippy remove needless references. * Allow op_ref rustc cannot infer the type returned by `generator`, taking a reference somehow allows rustc to work out what needs comparing - not exactly sure how. Clippy emits a warning because we take the reference, instruct Clippy to allow this and add a comment. * Use the inc operator Do not manually increment by 1. Found by Clippy. * Use cominator is_ok Remove unnecessary assertions and assert on the result of the `.is_ok()` combinator. Found by Clippy. * Remove unneeded local binding No need for this local variable and the noop statement using it. * Use as_deref As suggested by Clippy use `as_deref` instead of `as_ref` followed by `map`. * Deny clippy warnings at CI * Borrow self in BitManipulation Recently we removed type annotations from the self argument of the `BitManipulation` trait methods. In doing so we introduced different behaviour making the methods consume self, this was wrong. Do not consume self, borrow instead. * Use Zip instead of index access Instead of looping over a range, and using array index access to get elements of two arrays, we can use the `zip` combinator. This has the added advantage of preventing an index out of bounds error. * Fix spelling of commitments Fix typo in the spelling of commitments in code comment. * examples: Print Pedersen Commitment Pretty print to stdout the result of creating a Pedersen commitment. Co-authored-by: Tobin Harding <[email protected]> Co-authored-by: Denis <[email protected]>
- Loading branch information
1 parent
607ea8a
commit 8d33838
Showing
28 changed files
with
217 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.