Skip to content

Commit

Permalink
refac: use range instead of ||
Browse files Browse the repository at this point in the history
  • Loading branch information
devwckd committed Dec 19, 2024
1 parent 789798e commit 7c83aee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pallets/governance/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ pub fn submit_application<T: crate::Config>(
.try_into()
.map_err(|_| crate::Error::<T>::InvalidApplicationDataLength)?;

if data_len < T::MinApplicationDataLength::get()
|| data_len > T::MaxApplicationDataLength::get()
{
let data_range = T::MinApplicationDataLength::get()..T::MaxApplicationDataLength::get();
if !data_range.contains(&data_len) {
return Err(crate::Error::<T>::InvalidApplicationDataLength.into());
}

Expand Down

0 comments on commit 7c83aee

Please sign in to comment.