-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Uses* (again) #2537
No Uses* (again) #2537
Conversation
Unlike the failed attempt, the objective of this pr is not to reduce the number of trait bounds.
In this PR, 1 is the target, and for this I can do it with this independent PR then we can graducally fix 1. |
@@ -127,14 +112,16 @@ where | |||
} | |||
} | |||
|
|||
impl<S, Q, CS, F, M, O> HasQueueCycles for SupportedSchedulers<S, Q, CS, F, M, O> | |||
impl<CS, F, I, M, O, S, Q> HasQueueCycles for SupportedSchedulers<CS, F, I, M, O, S, Q> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't get how more generics is better, here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better because i get rid of UsesState and UsesInput.
And using UsesState
and UsesInput
was the wrong solution if you want to reduce the number of generics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well having the input associated with a state doesn't sound necessarily wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah so i'm not removing UsesInput from StdState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what addison said is that you should only have associated X when you can define the getter to it
for example you can define input() and input_mut() so i can implement UsesInput for StdState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but in this PR.
you can't implement fn state() or fn input() for this scheduler, then you don't implement UsesState, UsesInput.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I fully understand, but just do what you thank and we see how it looks?
Can you see if this is good to you? @addisoncrump I was too lazy to remove default implementation from traits (for example, it's totally possible to remove HasCorpus from Scheduler's Also this is not trying to fix every occurence of Use*, but make incremental progress towards the end goal while keeping everything working |
No description provided.