Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

secret-store fix warning in tests #9074

Merged
merged 1 commit into from
Jul 9, 2018
Merged

Conversation

niklasad1
Copy link
Collaborator

Fixes:

warning: unused return value of `std::iter::Iterator::collect` which must be used
   --> secret_store/src/key_server_cluster/math.rs:590:3
    |
590 |           (0..n).map(|i| (0..n).map(|j| if i != j {
    |  _________^
591 | |             assert!(keys_verification(t, &derived_point, &id_numbers[i], &secrets1[j][i], &secrets2[j][i], &publics[j]).unwrap());
592 | |         }).collect::<Vec<_>>()).collect::<Vec<_>>();
    | |____________________________________________________^
    |
    = note: #[warn(unused_must_use)] on by default
    = note: if you really need to exhaust the iterator, consider `.for_each(drop)` instead

@niklasad1 niklasad1 requested a review from svyatonik July 9, 2018 08:48
@niklasad1 niklasad1 added A0-pleasereview 🤓 Pull request needs code review. A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). labels Jul 9, 2018
@5chdn 5chdn added this to the 2.0 milestone Jul 9, 2018
.for_each(|j| {
assert!(keys_verification(t, &derived_point, &id_numbers[i], &secrets1[j][i], &secrets2[j][i], &publics[j]).unwrap());
})
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would find nested for loops easier to read, i.e.

for i in 0 .. n {
	for j in 0 .. n {
		if i != j {
			...
		}
	}
}

@5chdn 5chdn added A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jul 9, 2018
@5chdn 5chdn merged commit 9f1e086 into master Jul 9, 2018
@5chdn 5chdn deleted the secret-store/fix-warn-in-test branch July 9, 2018 14:48
dvdplm added a commit that referenced this pull request Jul 10, 2018
* master:
  Clean up deprecated options and add CHECK macro (#9036)
  Replace `std::env::home_dir` with `dirs::home_dir` (#9077)
  fix warning in secret-store test (#9074)
  SeedHashCompute remove needless `new` impl (#9063)
  remove trait bounds from several structs (#9055)
  docs: add changelog for 1.10.9 stable and 1.11.6 beta (#9069)
  Enable test in `miner/pool/test` (#9072)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants