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

Contains trait seems missused and with outdated documentation. #5706

Closed
gui1117 opened this issue Apr 20, 2020 · 0 comments · Fixed by #5723
Closed

Contains trait seems missused and with outdated documentation. #5706

gui1117 opened this issue Apr 20, 2020 · 0 comments · Fixed by #5723

Comments

@gui1117
Copy link
Contributor

gui1117 commented Apr 20, 2020

the doc of trait Contains say:

/// A trait for querying whether a type can be said to statically "contain" a value. Similar
/// in nature to `Get`, except it is designed to be lazy rather than active (you can't ask it to
/// enumerate all values that it contains) and work for multiple values rather than just one.
pub trait Contains<T: Ord> {

But first it contains fn sorted_members() -> Vec<T> which contradict its doc

And second it is implemented by election phragmen. As elected set are contained.
It can change every N blocks, is that a legit implementation of the trait ?

can we expect an implementation of Get to change every era and involves storage reads?

I think the trait should be changed (either renamed or change its doc)

@gui1117 gui1117 changed the title Contains trait seems misused and with outdated documentation. Contains trait seems missused and with outdated documentation. Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant