We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2f3ac6 commit 72aa660Copy full SHA for 72aa660
ballot/src/lib.rs
@@ -29,7 +29,7 @@ impl Ballot {
29
pub fn validate(&self) -> Result<(), String> {
30
// Validate each probability
31
for (&proof_type, &prob) in self.probabilities.iter() {
32
- if 0.0 > prob && 1.0 < prob {
+ if !(0.0..=1.0).contains(&prob) {
33
return Err(format!(
34
"Invalid probability value {} for proof type {:?}, must be between 0 and 1",
35
prob, proof_type
0 commit comments