Use same fmt and clippy configs as in Substrate (#7611)

* Use same rustfmt.toml as Substrate

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* format format file

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Format with new config

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add Substrate Clippy config

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Print Clippy version in CI

Otherwise its difficult to reproduce locally.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make fmt happy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update node/core/pvf/src/error.rs

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

* Update node/core/pvf/src/error.rs

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-08-14 16:29:29 +02:00
committed by GitHub
parent ac435c96cf
commit 342d720573
203 changed files with 1880 additions and 1504 deletions
+9 -8
View File
@@ -96,8 +96,8 @@ pub enum ValidityDoubleVote<Candidate, Digest, Signature> {
}
impl<Candidate, Digest, Signature> ValidityDoubleVote<Candidate, Digest, Signature> {
/// Deconstruct this misbehavior into two `(Statement, Signature)` pairs, erasing the information
/// about precisely what the problem was.
/// Deconstruct this misbehavior into two `(Statement, Signature)` pairs, erasing the
/// information about precisely what the problem was.
pub fn deconstruct<Ctx>(
self,
) -> ((Statement<Candidate, Digest>, Signature), (Statement<Candidate, Digest>, Signature))
@@ -124,8 +124,8 @@ pub enum DoubleSign<Candidate, Digest, Signature> {
}
impl<Candidate, Digest, Signature> DoubleSign<Candidate, Digest, Signature> {
/// Deconstruct this misbehavior into a statement with two signatures, erasing the information about
/// precisely where in the process the issue was detected.
/// Deconstruct this misbehavior into a statement with two signatures, erasing the information
/// about precisely where in the process the issue was detected.
pub fn deconstruct(self) -> (Statement<Candidate, Digest>, Signature, Signature) {
match self {
Self::Seconded(candidate, a, b) => (Statement::Seconded(candidate), a, b),
@@ -555,10 +555,11 @@ impl<'a, Ctx: Context> Iterator for DrainMisbehaviors<'a, Ctx> {
type Item = (Ctx::AuthorityId, MisbehaviorFor<Ctx>);
fn next(&mut self) -> Option<Self::Item> {
// Note: this implementation will prematurely return `None` if `self.drain.next()` ever returns a
// tuple whose vector is empty. That will never currently happen, as the only modification
// to the backing map is currently via `drain` and `entry(...).or_default().push(...)`.
// However, future code changes might change that property.
// Note: this implementation will prematurely return `None` if `self.drain.next()` ever
// returns a tuple whose vector is empty. That will never currently happen, as the only
// modification to the backing map is currently via `drain` and
// `entry(...).or_default().push(...)`. However, future code changes might change that
// property.
self.maybe_item().or_else(|| {
self.in_progress = self.drain.next().map(Into::into);
self.maybe_item()