Repository navigation
new ASIO host implementation - #1331
LastExceed wants to merge 27 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
9c95154 to
b6cc570
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Ah right, I had missed the |
This comment was marked as resolved.
This comment was marked as resolved.
|
I moved them to the platform dependencies for now to be consistent with what we currently have, but it might be worth revisiting this in the future as it could get rid of some duplicates. E.g. |
This comment was marked as resolved.
This comment was marked as resolved.
774c869 to
15346d6
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
|
I agree that there are definitely some places where rustfmt is in my opinion making code less readable, keeping a codebase (like cpal) legible and clear is important, but I think just being logical can exceed rustfmt in terms of neatness |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
6c43e14 to
39c88b2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
@roderickvd any final thoughts on this? @LastExceed thinks it's ready to merged, and it's something I'd personally like to see :) |
| } | ||
|
|
||
| fn id(&self) -> CpalResult<DeviceId> { | ||
| self.0.id().pipe(Ok) |
There was a problem hiding this comment.
I feel that in situations like this .pipe() is unneeded, and loses its value, which is helping long, divergent/chaining bits of code (where it can be extremely usefull). Here it just feels a bit unidiomatic imo
There was a problem hiding this comment.
I'm fine with changing it, but:
The idea is to align the the reading order with the logical order of operations (and avoid nesting). Wrapping the value in Ok() is the last operation this expression performs, so I like it being the last lexical token too (for the same reason I also wish Rust had postfix return syntax, but I digress). The conventional style would be Ok(self.0.id()), which makes Ok the first thing instead, which means you'll have to keep it in the back of your head while comprehending the inner expression. In this particular case its quite trivial since the expression is quite simple, but when the inner expression is complex, this can be a mental overhead. The question is, where do we draw the line? How big does the inner expression have to be for the linearity of .pipe() to outweigh the familiarity and brevity of the conventional approach? (I don't have an answer to this)
Anyway, let me know which other occurrences you'd like to have changed (or just commit the changes directly, thats fine too).
Closes #1299
Obsoletes #1083