Skip to content

Commit

Permalink
Fix all warnings added with rustc 1.72.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Aug 28, 2023
1 parent 64d177e commit e69e8bb
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"

members = [
"rascaline",
Expand Down
2 changes: 1 addition & 1 deletion docs/rascaline-json-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rascaline-json-schema"
version = "0.1.0"
authors = ["Luthaf <[email protected]>"]
edition = "2018"
edition = "2021"
publish = false
rust-version = "1.64"

Expand Down
10 changes: 5 additions & 5 deletions rascaline/src/calculator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<'a> LabelsSelection<'a> {
{
assert_ne!(keys.count(), 0);

match self {
match *self {
LabelsSelection::All => {
return get_default_labels(keys);
},
Expand All @@ -69,7 +69,7 @@ impl<'a> LabelsSelection<'a> {
if selection.names() == default_names {
for labels in default_labels {
let mut builder = LabelsBuilder::new(default_names.clone());
for entry in selection.iter() {
for entry in selection {
if labels.contains(entry) {
builder.add(entry);
}
Expand All @@ -93,8 +93,8 @@ impl<'a> LabelsSelection<'a> {

for labels in default_labels {
let mut builder = LabelsBuilder::new(default_names.clone());
for entry in labels.iter() {
for selected in selection.iter() {
for entry in &labels {
for selected in selection {
let mut matches = true;
for (i, &v) in variables_to_match.iter().enumerate() {
if selected[i] != entry[v] {
Expand Down Expand Up @@ -124,7 +124,7 @@ impl<'a> LabelsSelection<'a> {
tensor.keys().names().join(", ")
)));
}
for key in keys.iter() {
for key in keys {
if !tensor.keys().contains(key) {
let key_print = keys.names().iter()
.zip(key)
Expand Down
2 changes: 1 addition & 1 deletion rascaline/src/calculators/atomic_composition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl CalculatorBase for AtomicComposition {
) -> Result<(), Error> {
assert_eq!(descriptor.keys().names(), ["species_center"]);

for (key, mut block) in descriptor.iter_mut() {
for (key, mut block) in descriptor {
let species_center = key[0].i32();

let block = block.data_mut();
Expand Down
2 changes: 1 addition & 1 deletion rascaline/src/calculators/dummy_calculator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl CalculatorBase for DummyCalculator {
warn!("{}", self.name);
}

for (key, mut block) in descriptor.iter_mut() {
for (key, mut block) in descriptor {
let species_center = key[0].i32();

let block_data = block.data_mut();
Expand Down
2 changes: 1 addition & 1 deletion rascaline/src/calculators/lode/spherical_expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ impl CalculatorBase for LodeSphericalExpansion {

let k_vector_to_m_n = &k_vector_to_m_n[spherical_harmonics_l];

for (&species_neighbor, sf_per_center) in sf_per_center.iter() {
for (&species_neighbor, sf_per_center) in sf_per_center {
for center_i in 0..system.size()? {
let block_i = descriptor.keys().position(&[
spherical_harmonics_l.into(),
Expand Down
4 changes: 2 additions & 2 deletions rascaline/src/calculators/soap/power_spectrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl SoapPowerSpectrum {
spherical_expansion: &TensorMap
) -> HashMap<Vec<LabelValue>, SamplesMapping> {
let mut mapping = HashMap::new();
for (key, block) in descriptor.iter() {
for (key, block) in descriptor {
let species_center = key[0];
let species_neighbor_1 = key[1];
let species_neighbor_2 = key[2];
Expand Down Expand Up @@ -554,7 +554,7 @@ impl CalculatorBase for SoapPowerSpectrum {
(key, spx_block)
}).collect();

for (key, mut block) in descriptor.iter_mut() {
for (key, mut block) in descriptor {
let species_neighbor_1 = key[1];
let species_neighbor_2 = key[2];

Expand Down
2 changes: 1 addition & 1 deletion rascaline/src/calculators/soap/spherical_expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl SphericalExpansion {

let self_contribution = self.by_pair.self_contribution();

for (key, mut block) in descriptor.iter_mut() {
for (key, mut block) in descriptor {
let spherical_harmonics_l = key[0];
let species_center = key[1];
let species_neighbor = key[2];
Expand Down
4 changes: 2 additions & 2 deletions rascaline/src/calculators/soap/spherical_expansion_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl SphericalExpansionByPair {
debug_assert_eq!(descriptor.keys().names(), ["spherical_harmonics_l", "species_atom_1", "species_atom_2"]);
let self_contribution = self.self_contribution();

for (key, mut block) in descriptor.iter_mut() {
for (key, mut block) in descriptor {
let spherical_harmonics_l = key[0];
let species_atom_1 = key[1];
let species_atom_2 = key[2];
Expand Down Expand Up @@ -373,7 +373,7 @@ impl SphericalExpansionByPair {
let radial_integral = radial_integral.values.slice(s![spherical_harmonics_l, ..]);

// compute the full spherical expansion coefficients & gradients
for sph_value in spherical_harmonics.iter() {
for sph_value in spherical_harmonics {
for (n, ri_value) in radial_integral.iter().enumerate() {
contribution.values[[lm_index, n]] = f_scaling * sph_value * ri_value;
}
Expand Down
2 changes: 1 addition & 1 deletion rascaline/src/calculators/sorted_distances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl CalculatorBase for SortedDistances {
assert_eq!(descriptor.keys().names(), ["species_center"]);
}

for (key, mut block) in descriptor.iter_mut() {
for (key, mut block) in descriptor {
let species_neighbor = if self.separate_neighbor_species {
Some(key[1].i32())
} else {
Expand Down

0 comments on commit e69e8bb

Please sign in to comment.