Skip to content

Commit

Permalink
Fix nightly lints (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBF authored Jun 9, 2022
1 parent afafb66 commit 127aa0f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ext/crates/algebra/src/algebra/adem_algebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub trait AdemAlgebraT: Send + Sync + Algebra {

impl AdemAlgebraT for AdemAlgebra {
fn adem_algebra(&self) -> &AdemAlgebra {
&*self
self
}
}

Expand Down Expand Up @@ -367,7 +367,7 @@ impl GeneratedAlgebra for AdemAlgebra {
ps: vec![degree as u32 / (2 * p - 2)],
p_or_sq: *self.prime() != 2,
});
return vec![idx];
vec![idx]
} else {
// I guess we're assuming here that not generic ==> p == 2. There's probably tons of places we assume that though.
if degree.count_ones() != 1 {
Expand All @@ -379,7 +379,7 @@ impl GeneratedAlgebra for AdemAlgebra {
ps: vec![degree as u32],
p_or_sq: *self.prime() != 2,
});
return vec![idx];
vec![idx]
}
}

Expand Down
4 changes: 2 additions & 2 deletions ext/crates/algebra/src/module/free_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ impl<const U: bool, A: MuAlgebra<U>> Module for MuFreeModule<U, A> {
} else {
op_str.push(' ');
}
return format!(
format!(
"{}{}",
op_str, self.gen_names[opgen.generator_degree][opgen.generator_index]
);
)
}

fn act_on_basis(
Expand Down
4 changes: 2 additions & 2 deletions ext/crates/algebra/src/module/hom_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ impl<M: Module> Module for HomModule<M> {
.operation_generator_to_index(0, 0, gen_deg, gen_idx);
let basis_deg = gen_deg - degree;
let basis_idx = gen_basis_elt.basis_index;
return format!(
format!(
"{}*⊗{}",
self.source.basis_element_to_string(gen_deg, gen_mod_idx),
self.target.basis_element_to_string(basis_deg, basis_idx),
);
)
}
}

Expand Down
3 changes: 2 additions & 1 deletion ext/crates/once/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ impl<T> Drop for OnceVec<T> {
// but if we can acquire the lock we want to drop the elements inside. If the lock is
// poisoned, then we are probably panicking so we don't care about memory leakage.
if let Ok(ooo) = self.ooo.lock() {
for entry in ooo.0.iter() {
let ooo_iter = ooo.0.iter();
for entry in ooo_iter {
std::ptr::drop_in_place(self.entry_ptr(*entry));
}
}
Expand Down
2 changes: 1 addition & 1 deletion ext/src/chain_complex/finite_chain_complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<M: Module> FiniteChainComplex<M, FullModuleHomomorphism<M>> {
&self,
mut f: impl FnMut(&M) -> N,
) -> FiniteChainComplex<N, FullModuleHomomorphism<N>> {
let modules: Vec<Arc<N>> = self.modules.iter().map(|m| Arc::new(f(&*m))).collect();
let modules: Vec<Arc<N>> = self.modules.iter().map(|m| Arc::new(f(m))).collect();
let zero_module = Arc::new(f(&*self.zero_module));
let differentials: Vec<_> = self
.differentials
Expand Down
2 changes: 1 addition & 1 deletion ext/src/secondary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl<A: PairAlgebra + Send + Sync> SecondaryHomotopy<A> {
let timer = Timer::start();

for (coef, d1, d0) in &maps {
composite.add_composite(*coef, t, idx, &*d1, &*d0);
composite.add_composite(*coef, t, idx, d1, d0);
}
composite.finalize();

Expand Down

0 comments on commit 127aa0f

Please sign in to comment.