Skip to content

Commit 6c5e9cc

Browse files
committed
Fix clippy issues.
1 parent ec64c89 commit 6c5e9cc

7 files changed

+13
-16
lines changed

src/_aeon_parser/_from_string_for_fn_update_temp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn parse_update_function(data: &[Token]) -> Result<Box<FnUpdateTemp>, String> {
114114

115115
/// **(internal)** Utility method to find first occurrence of a specific token in the token tree.
116116
fn index_of_first(data: &[Token], token: Token) -> Option<usize> {
117-
return data.iter().position(|t| *t == token);
117+
data.iter().position(|t| *t == token)
118118
}
119119

120120
/// **(internal)** Recursive parsing step 1: extract `<=>` operators.

src/_impl_extended_boolean.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ impl Display for ExtendedBoolean {
3939

4040
/// Implements a "set-like" ordering for extended Booleans. "Any" is greater than constant values
4141
/// (since it covers both values), while constant values are incomparable between each other.
42-
4342
impl PartialOrd for ExtendedBoolean {
4443
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
4544
match (self, other) {

src/fixed_points/symbolic_iterator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct SymbolicIterator<'a> {
3535
inner: RawSymbolicIterator<'a>,
3636
}
3737

38-
impl<'a> Iterator for RawSymbolicIterator<'a> {
38+
impl Iterator for RawSymbolicIterator<'_> {
3939
type Item = Bdd;
4040

4141
fn next(&mut self) -> Option<Self::Item> {
@@ -162,7 +162,7 @@ impl<'a> Iterator for RawSymbolicIterator<'a> {
162162
}
163163
}
164164

165-
impl<'a> RawSymbolicIterator<'a> {
165+
impl RawSymbolicIterator<'_> {
166166
/// Try to split this iterator into two independent disjoint iterators, assuming there are
167167
/// enough forks to permit such operation.
168168
pub fn try_split(&mut self) -> Option<Self> {
@@ -180,7 +180,7 @@ impl<'a> RawSymbolicIterator<'a> {
180180
}
181181
}
182182

183-
impl<'a> Iterator for SymbolicIterator<'a> {
183+
impl Iterator for SymbolicIterator<'_> {
184184
type Item = GraphColoredVertices;
185185

186186
fn next(&mut self) -> Option<Self::Item> {

src/sbml/import/_convert_mathml_to_fn_update.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub fn sbml_transition_to_update_function(
139139
panic!("Converting an unspecified transition to FnUpdate.");
140140
}
141141

142-
return if transition.function_terms.is_empty() {
142+
if transition.function_terms.is_empty() {
143143
if transition.default_term.as_ref().unwrap().result_level == 0 {
144144
Ok(FnUpdate::Const(false))
145145
} else if transition.default_term.as_ref().unwrap().result_level == 1 {
@@ -163,7 +163,7 @@ pub fn sbml_transition_to_update_function(
163163
} else {
164164
math_to_update(term.math.as_ref().unwrap(), network, transition, id_to_var)
165165
}
166-
};
166+
}
167167
}
168168

169169
/// **(internal)** Utility function for turning comparisons into valid `FnUpdate` functions.

src/symbolic_async_graph/_impl_symbolic_async_graph.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ impl SymbolicAsyncGraph {
10451045
// Ideally, all parameters should be used, but just in case they are not, we should also
10461046
// go through those that are not used:
10471047
let mut unused_parameters: HashSet<ParameterId> = HashSet::from_iter(bn.parameters());
1048-
for (_, v) in &clusters {
1048+
for v in clusters.values() {
10491049
for p in v {
10501050
if unused_parameters.contains(p) {
10511051
unused_parameters.remove(p);
@@ -1092,9 +1092,7 @@ impl SymbolicAsyncGraph {
10921092
})
10931093
.collect::<Vec<_>>();
10941094

1095-
if !unique_interpretations.contains_key(&key) {
1096-
unique_interpretations.insert(key, valuation);
1097-
}
1095+
unique_interpretations.entry(key).or_insert(valuation);
10981096
}
10991097
println!("Unique: {:?}", unique_interpretations.len());
11001098
for (k, v) in unique_interpretations.iter() {

src/symbolic_async_graph/_impl_symbolic_context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ impl SymbolicContext {
579579

580580
/// **(internal)** Utility method for converting `FnUpdate` arguments to `Bdd` arguments.
581581
fn prepare_args(&self, args: &[FnUpdate]) -> Vec<Bdd> {
582-
return args.iter().map(|v| self.mk_fn_update_true(v)).collect();
582+
args.iter().map(|v| self.mk_fn_update_true(v)).collect()
583583
}
584584

585585
/// This is similar to [BddVariableSet::transfer_from], but applied at the level of

src/symbolic_async_graph/projected_iteration.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn restrict_valuation(valuation: BddValuation, retain: &[BddVariable]) -> BddPar
130130
partial
131131
}
132132

133-
impl<'a> Iterator for RawSymbolicIterator<'a> {
133+
impl Iterator for RawSymbolicIterator<'_> {
134134
type Item = BddPartialValuation;
135135

136136
fn next(&mut self) -> Option<Self::Item> {
@@ -188,7 +188,7 @@ impl StateProjection {
188188
}
189189
}
190190

191-
impl<'a> Iterator for StateProjectionIterator<'a> {
191+
impl Iterator for StateProjectionIterator<'_> {
192192
type Item = Vec<(VariableId, bool)>;
193193

194194
fn next(&mut self) -> Option<Self::Item> {
@@ -247,7 +247,7 @@ impl<'a> FnUpdateProjection<'a> {
247247
}
248248
}
249249

250-
impl<'a, 'b> Iterator for FnUpdateProjectionIterator<'a, 'b> {
250+
impl Iterator for FnUpdateProjectionIterator<'_, '_> {
251251
type Item = Vec<(VariableId, FnUpdate)>;
252252

253253
fn next(&mut self) -> Option<Self::Item> {
@@ -313,7 +313,7 @@ impl<'a> MixedProjection<'a> {
313313
}
314314
}
315315

316-
impl<'a, 'b> Iterator for MixedProjectionIterator<'a, 'b> {
316+
impl Iterator for MixedProjectionIterator<'_, '_> {
317317
type Item = (Vec<(VariableId, bool)>, Vec<(VariableId, FnUpdate)>);
318318

319319
fn next(&mut self) -> Option<Self::Item> {

0 commit comments

Comments
 (0)