-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
What's the motivation behind replacing |
Getting rid of bloated error types which contain the same kind of errors on multiple levels and are never matched. I believe that if the 'error' is created only in one place and is never matched it does not deserve it's own type |
} | ||
} | ||
|
||
fn push_work_all(&self, payload: String, tcp_dispatcher: &Dispatcher) -> Result<(), Error> { | ||
fn push_work_all(&self, payload: String, tcp_dispatcher: &Dispatcher) { |
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.
wow, so this method has actually always returned an Ok(())
, 👍
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.
Addressed this in #11161
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.
IMHO String
ifying errors is completely backwards, I don't understand how this cleans things up. By looking at the error enumeration you could at least roughly identify negative cases which gives a tremendous insight into the code.
I don't see this change as an improvement at all, I think that rather we should eradicate ALL String
error types in the codebase.
I'm not sure I agree with this either, in particular I think that a proper error type helps readability – at a glance I know what the anticipated error conditions for a crate/module are. New devs looking at the code are going to go look for the errors too, and if they have to chase around for strings sprinkled all over the place they'll hate us. @debris when you say that the error types are bloated, what are you referring to? You mean actually bloated as in "a potential performance problem" or more "unneeded type wankery"? |
Salvage some code from #10884 + some cleanup and typos.
* Cleanup stratum a bit Salvage some code from #10884 + some cleanup and typos. * HashSet::new does not allocate before first insert * Remove unused method push_work()
Closing as stale. |
* Cleanup stratum a bit Salvage some code from #10884 + some cleanup and typos. * HashSet::new does not allocate before first insert * Remove unused method push_work()
* Cleanup stratum a bit Salvage some code from #10884 + some cleanup and typos. * HashSet::new does not allocate before first insert * Remove unused method push_work()
No description provided.