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

Ensure cumulus/bridges is ignored by formatter and run it #1369

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ trailing_comma = "Vertical"
trailing_semicolon = false
use_field_init_shorthand = true
ignore = [
"bridges",
"cumulus/bridges",
Copy link
Member

@ggwpez ggwpez Sep 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acatangiu this should be remove, or?
The current formatting files was merged as part of the monorepo import.

]
edition = "2021"
# Format comments
comment_width = 100
wrap_comments = true
wrap_comments = true
14 changes: 8 additions & 6 deletions substrate/client/network/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,9 +943,10 @@ where
peers: HashSet<Multiaddr>,
) -> Result<(), String> {
let Some(set_id) = self.notification_protocol_ids.get(&protocol) else {
return Err(
format!("Cannot add peers to reserved set of unknown protocol: {}", protocol)
)
return Err(format!(
"Cannot add peers to reserved set of unknown protocol: {}",
protocol
))
};

let peers = self.split_multiaddr_and_peer_id(peers)?;
Expand Down Expand Up @@ -974,9 +975,10 @@ where
peers: Vec<PeerId>,
) -> Result<(), String> {
let Some(set_id) = self.notification_protocol_ids.get(&protocol) else {
return Err(
format!("Cannot remove peers from reserved set of unknown protocol: {}", protocol)
)
return Err(format!(
"Cannot remove peers from reserved set of unknown protocol: {}",
protocol
))
};

for peer_id in peers.into_iter() {
Expand Down
6 changes: 4 additions & 2 deletions substrate/client/rpc-spec-v2/src/chain_head/chain_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ where
follow_subscription: String,
operation_id: String,
) -> RpcResult<()> {
let Some(operation) = self.subscriptions.get_operation(&follow_subscription, &operation_id) else {
let Some(operation) = self.subscriptions.get_operation(&follow_subscription, &operation_id)
else {
return Ok(())
};

Expand All @@ -479,7 +480,8 @@ where
follow_subscription: String,
operation_id: String,
) -> RpcResult<()> {
let Some(operation) = self.subscriptions.get_operation(&follow_subscription, &operation_id) else {
let Some(operation) = self.subscriptions.get_operation(&follow_subscription, &operation_id)
else {
return Ok(())
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ where

let mut ret = Vec::with_capacity(self.operation_max_storage_items);
for _ in 0..self.operation_max_storage_items {
let Some(key) = keys_iter.next() else {
break
};
let Some(key) = keys_iter.next() else { break };

let result = match ty {
IterQueryType::Value => self.query_storage_value(hash, &key, child_key),
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/broker/src/dispatchable_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ impl<T: Config> Pallet<T> {
contribution.length.saturating_dec();

let Some(mut pool_record) = InstaPoolHistory::<T>::get(r) else {
continue;
continue
};
let Some(total_payout) = pool_record.maybe_payout else {
break;
break
};
let p = total_payout
.saturating_mul(contributed_parts.into())
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/broker/src/tick_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl<T: Config> Pallet<T> {

pub(crate) fn process_revenue() -> bool {
let Some((until, amount)) = T::Coretime::check_notify_revenue_info() else {
return false;
return false
};
let when: Timeslice =
(until / T::TimeslicePeriod::get()).saturating_sub(One::one()).saturated_into();
Expand Down Expand Up @@ -290,7 +290,7 @@ impl<T: Config> Pallet<T> {
core: CoreIndex,
) {
let Some(workplan) = Workplan::<T>::take((timeslice, core)) else {
return;
return
};
let workload = Workload::<T>::get(core);
let parts_used = workplan.iter().map(|i| i.mask).fold(CoreMask::void(), |a, i| a | i);
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/safe-mode/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ pub mod pallet {
/// [`EnteredUntil`].
fn on_initialize(current: BlockNumberFor<T>) -> Weight {
let Some(limit) = EnteredUntil::<T>::get() else {
return T::WeightInfo::on_initialize_noop();
return T::WeightInfo::on_initialize_noop()
};

if current > limit {
Expand Down