-
Notifications
You must be signed in to change notification settings - Fork 316
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
refactor(storage-proofs): fix clippy warnings #1147
refactor(storage-proofs): fix clippy warnings #1147
Commits on Jun 18, 2020
-
style(storage-proofs): collapse else if block
clippy emits error: error: this `else { if .. }` block can be collapsed Do what clippy suggests, collapse the else if block.
Configuration menu - View commit details
-
Copy full SHA for 6861b07 - Browse repository at this point
Copy the full SHA 6861b07View commit details -
style(storage-proofs): remove unused import
In test module we bring into scope `rand` but do not use it (thread_rng() is called using a qualified path). Remove the unused `rand` import.
Configuration menu - View commit details
-
Copy full SHA for 68ec2f7 - Browse repository at this point
Copy the full SHA 68ec2f7View commit details -
refactor(storage-proofs): use iter() instead of into_iter()
As suggested by clippy we can use `iter()` instead of `into_iter() in a bunch of places.`
Configuration menu - View commit details
-
Copy full SHA for 339ed4e - Browse repository at this point
Copy the full SHA 339ed4eView commit details -
refactor(storage-proofs): use slice directly
Clippy emits a bunch of warnings of type: warning: useless use of `vec!` And suggests that we can use a slice direcly help: you can use a slice directly: `&[None; 256]` Do as clippy suggests; use slices directly.
Configuration menu - View commit details
-
Copy full SHA for 6b00682 - Browse repository at this point
Copy the full SHA 6b00682View commit details -
refactor(storage-proofs): use iterator instead of for loop
Found with clippy; we are using a for loop but the current lint level requires us to use an iterator. As suggested; use an iterator instead of the for loop.
Configuration menu - View commit details
-
Copy full SHA for 8fc2a3e - Browse repository at this point
Copy the full SHA 8fc2a3eView commit details -
refactor(storage-proofs): remove unneeded mutable reference
Found with clippy; `bytes_to_fr` does not need a mutable reference.
Configuration menu - View commit details
-
Copy full SHA for a5ff82f - Browse repository at this point
Copy the full SHA a5ff82fView commit details -
refactor(storage-proofs): remove unnecessary into()
Remove unnecessary usage of `into()`, found by clippy.
Configuration menu - View commit details
-
Copy full SHA for 71f094d - Browse repository at this point
Copy the full SHA 71f094dView commit details -
refactor(storage-proofs): remove unnecessary clone()
Remove unnecessary usage of `clone()`, found by clippy.
Configuration menu - View commit details
-
Copy full SHA for 5f5c4cd - Browse repository at this point
Copy the full SHA 5f5c4cdView commit details -
refactor(storage-proofs): remove reference from match pattern
Clippy emits error: error: you don't need to add `&` to all patterns Along with the suggestion to dereference the expression instead of prefixing all patters with `&`. Do as suggested by clippy and dereference the expressions.
Configuration menu - View commit details
-
Copy full SHA for b24a50a - Browse repository at this point
Copy the full SHA b24a50aView commit details -
refactor(storage-proofs): use dedicated
copied
methodClippy emits two errors of type: error: You are using an explicit closure for copying elements Along with the suggestion to us `copied` instead. Do as clippy suggests.
Configuration menu - View commit details
-
Copy full SHA for 26f6675 - Browse repository at this point
Copy the full SHA 26f6675View commit details -
refactor(storage-proofs): include function in criterion_group
The function `pedersen_md_circuit_benchmark` is defined but not used, it appears that this function should be added to the `criterion_group` marcro call. Found by clippy.
Configuration menu - View commit details
-
Copy full SHA for 8d1b060 - Browse repository at this point
Copy the full SHA 8d1b060View commit details -
refactor(storage-proofs): remove unnecessary use
`tempfile` is brought into scope but is never used. Found by clippy.
Configuration menu - View commit details
-
Copy full SHA for 1ca55ff - Browse repository at this point
Copy the full SHA 1ca55ffView commit details -
refactor(storage-proofs): remove unnecessary ()
Plain old `return;` is idiomatic Rust these days, found by clippy.
Configuration menu - View commit details
-
Copy full SHA for 27a4174 - Browse repository at this point
Copy the full SHA 27a4174View commit details -
refactor(storage-proofs): remove unused local variable
We declare a local buffer and never use it. Found by clippy.
Configuration menu - View commit details
-
Copy full SHA for afadb20 - Browse repository at this point
Copy the full SHA afadb20View commit details -
refactor(storage-proofs): use separators
Clippy emits error: error: long literal lacking separators Use separators, as suggested by clippy, to assist reading.
Configuration menu - View commit details
-
Copy full SHA for 097349c - Browse repository at this point
Copy the full SHA 097349cView commit details -
refactor(storage-proofs): pass unit directly
Clippy emits warning: warning: passing a unit value to a function The argument in question is not actually used by the function `circuit` (if I've jumped to the correct definition). We can safely pass in unit `()` instead. Does this result in any loss of meaning?
Configuration menu - View commit details
-
Copy full SHA for 747bbcc - Browse repository at this point
Copy the full SHA 747bbccView commit details -
refactor(filecoin-proofs): use consistent underscoring
Clippy emits warning warning: digits grouped inconsistently by underscores Add an underscore, as suggested, in order to be consistent.
Configuration menu - View commit details
-
Copy full SHA for ff23373 - Browse repository at this point
Copy the full SHA ff23373View commit details -
refactor(filecoin-proofs): remove redundant import
Import is unused; found by clippy.
Configuration menu - View commit details
-
Copy full SHA for c43cf3c - Browse repository at this point
Copy the full SHA c43cf3cView commit details -
refactor(filecoin-proofs): remove unnecessary into_iter()
Clippy emits error: error: identical conversion Remove, as suggested by clippy, unnecessary `into_iter()`.
Configuration menu - View commit details
-
Copy full SHA for 5f80973 - Browse repository at this point
Copy the full SHA 5f80973View commit details -
refactor(filecoin-proofs): use iterator instead of indexing
Clippy emits error: error: the loop variable `i` is used to index `val` Use an iterator, as suggested, to loop over the arrays of bytes. Use combinators `skip` and `take` as needed.
Configuration menu - View commit details
-
Copy full SHA for ea04524 - Browse repository at this point
Copy the full SHA ea04524View commit details -
refactor(filecoin-proofs): use _f64 type
Clippy emits error: error: casting integer literal to `f64` is unnecessary Use `32_f64` as suggested instead of casting to an `f64`.
Configuration menu - View commit details
-
Copy full SHA for 6c2b6b3 - Browse repository at this point
Copy the full SHA 6c2b6b3View commit details -
refactor(filecoin-proofs): allow identity_op in test
Clippy emits error: error: the operation is ineffective. Consider reducing it to `127` This is caused because we use `1 * 127` in order to be consistent with other usages i.e., `2 * 127` and `8 * 127`. Clippy is wrong in this instance, the ineffective operation makes the code easier to read. Instruct clippy to allow this lint.
Configuration menu - View commit details
-
Copy full SHA for 0e3fc2e - Browse repository at this point
Copy the full SHA 0e3fc2eView commit details -
refactor(filecoin-proofs): remove useless use of vec!
Clippy emits warning/error; useless use of `vec!` Do as suggested by clippy and use a slice directly.
Configuration menu - View commit details
-
Copy full SHA for 108f8df - Browse repository at this point
Copy the full SHA 108f8dfView commit details -
refactor(filecoin-proofs): remove redundant clone
Clippy emits warning: warning: redundant clone Do as clippy suggests; remove redundant calls to `clone()`
Configuration menu - View commit details
-
Copy full SHA for 255d681 - Browse repository at this point
Copy the full SHA 255d681View commit details -
refactor(filecoin-proofs): remove clone on double reference
Clippy emits error: error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type This error is caused by code that is mildly convoluted by the fact that the only method on `TempDir` that returns a `PathBuf` consumes self. We cannot use that because at the call site we cannot consume the temp dir. To get around this we do a little dance of getting a reference to a `Path` and then calling `to_path_buf()` on it. We end up with code that looks kind of funky: self.cache_dire.path().to_path_buf() That's the best I could come up with :)
Configuration menu - View commit details
-
Copy full SHA for bd5c693 - Browse repository at this point
Copy the full SHA bd5c693View commit details -
refactor(filecoin-proofs): use unwrap_or_else
`unwrap_or_else()` is more performant than `unwrap_or`. Found by clippy.
Configuration menu - View commit details
-
Copy full SHA for d30ab86 - Browse repository at this point
Copy the full SHA d30ab86View commit details -
refactor(filecoin-proofs): use iter() directly
Clippy emits warning: warning: this `.into_iter()` call is equivalent to `.iter()` and will not move the `slice` Do as clippy suggests and use `iter()` directly.
Configuration menu - View commit details
-
Copy full SHA for f9d5822 - Browse repository at this point
Copy the full SHA f9d5822View commit details -
refactor(filecoin-proofs): use write_all
Clippy emits error: error: written amount is not handled. Use `Write::write_all` instead Use `write_all` as clippy suggests since we do not use the return result.
Configuration menu - View commit details
-
Copy full SHA for 3c2a891 - Browse repository at this point
Copy the full SHA 3c2a891View commit details -
refactor(filecoin-proofs): remove identical conversion
Clippy emits warning: warning: identical conversion Remove the call to `into_iter()`, as suggested by clippy, and use `iter()`.
Configuration menu - View commit details
-
Copy full SHA for 61eed54 - Browse repository at this point
Copy the full SHA 61eed54View commit details -
refactor(filecoin-proofs): no function call after expect
Clippy emits error: error: use of `expect` followed by a function call Do as suggested by clippy and use `unwrap_or_else()` coupled with `panic!` instead of calling `format!` as an argument to `expect()`.
Configuration menu - View commit details
-
Copy full SHA for 6e198bb - Browse repository at this point
Copy the full SHA 6e198bbView commit details -
refactor(fil-proofs-tooling): add separators
Clippy emits warning: warning: long literal lacking separators Add separators as suggested by clippy to assist reading.
Configuration menu - View commit details
-
Copy full SHA for 7aba1d0 - Browse repository at this point
Copy the full SHA 7aba1d0View commit details -
refactor(fil-proofs-tooling): all clippy lint float_cmp
We use a couple of strict float comparisons to test. In each case the strict comparison is ok. Add a lint ignore and also comment each site that does strict float comparison.
Configuration menu - View commit details
-
Copy full SHA for ed71a56 - Browse repository at this point
Copy the full SHA ed71a56View commit details -
refactor(storage-proofs): all clippy lint unit_arg
We use the `black_box` function in a bunch of places, at times the function argument returns unit, this is to be expected since the argument is not used for its return value. Instruct clippy to set the `unit_arg` lint to allow.
Configuration menu - View commit details
-
Copy full SHA for 6aa355f - Browse repository at this point
Copy the full SHA 6aa355fView commit details