-
Notifications
You must be signed in to change notification settings - Fork 34
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
Align on some rust conventions #392
Comments
WDYT about the aforementioned points @tillrohrmann ? In particular about error names, service names and the [component]_api/[component_impl] splitting. |
I think it is a good idea to improve our codebase's consistency.
|
Yes, I guess my question is: do we rename when consuming, or when exporting? I personally like renaming when cosuming: |
Haven't put much thought into this TBH. There are cases where I can clearly see when a type needs to be inside the |
The one thing that I don't like about renaming is that it makes things harder to back track because it introduces another layer of indirection. With this pattern, people will have to look at the use statement to find out the actual name if they want to go to the definition of the struct. |
So what do you think we should do then?
Right now I merged #528 following the renaming on consumption :) But can change, no strong opinion here, I do like renaming at least on exporting, as it makes less verbose the names within the crate, and it makes easier (at least for me) to reason about the crate apis. |
I like this approach, it is very common practice to separate I think that they rather to be separate crates, as they minimize the dependency scope |
For the renaming topic, I've checked a couple of projects:
All these rename on consumption the Error type of the respective modules. So I guess it makes sense to rename on consumption for us as well? |
This one is done, we can close it |
[module]Error
or simplyError
and use qualified imports such as[module]::Error
?[module]Service
or simplyService
and use qualified imports such as[module]::Service
? This one should probably be aligned with the error names decision.api
andimpl
crates. It probably makes sense to have them as subdirectories, e.g.[..]_util
vs[..]_utils
Tasks
The text was updated successfully, but these errors were encountered: