* Add clippy config and remove .cargo from gitignore

* first fixes

* Clippyfied

* Add clippy CI job

* comment out rusty-cachier

* minor

* fix ci

* remove DAG from check-dependent-project

* add DAG to clippy

Co-authored-by: alvicsam <alvicsam@gmail.com>
This commit is contained in:
alexgparity
2022-11-30 09:34:06 +01:00
committed by GitHub
parent b76086c617
commit 9ea14e66c8
67 changed files with 338 additions and 351 deletions
+5 -7
View File
@@ -483,7 +483,7 @@ impl<T: Config> Pallet<T> {
Some(CoreAssignment {
kind: AssignmentKind::Parachain,
para_id: parachains[core_index],
core: core.clone(),
core,
group_idx: Self::group_assigned_to_core(core, now).expect(
"core is not out of bounds and we are guaranteed \
to be after the most recent session start; qed",
@@ -496,7 +496,7 @@ impl<T: Config> Pallet<T> {
parathread_queue.take_next_on_core(core_offset).map(|entry| CoreAssignment {
kind: AssignmentKind::Parathread(entry.claim.1, entry.retries),
para_id: entry.claim.0,
core: core.clone(),
core,
group_idx: Self::group_assigned_to_core(core, now).expect(
"core is not out of bounds and we are guaranteed \
to be after the most recent session start; qed",
@@ -610,11 +610,9 @@ impl<T: Config> Pallet<T> {
(at - session_start_block) / config.group_rotation_frequency.into();
let rotations_since_session_start =
match <T::BlockNumber as TryInto<u32>>::try_into(rotations_since_session_start) {
Ok(i) => i,
Err(_) => 0, // can only happen if rotations occur only once every u32::max(),
// so functionally no difference in behavior.
};
<T::BlockNumber as TryInto<u32>>::try_into(rotations_since_session_start).unwrap_or(0);
// Error case can only happen if rotations occur only once every u32::max(),
// so functionally no difference in behavior.
let group_idx =
(core.0 as usize + rotations_since_session_start as usize) % validator_groups.len();