Closed wthrajat closed 3 weeks ago
Clippy has been recently updated with a new lint: Too long first doc paragraph
as described in doc_mod.rs.
Pushed the fix in 7d3ff35
@wthrajat can you make the long doc fix in a separate PR and I will merge it quickly. This error will trickle into other PRs too.
@wthrajat Can you squeeze the commits.
@wthrajat any update on this?
@mojoX911
Updated Changes:
write_default_config
function from utill.rs
.update_directory_config
for the directory server.MakerConfig
and TakerConfig
to use their respective write_to_file
methods.Reasoning:
write_default_config
function was being used in multiple places, including directory.rs
. Since we cannot reuse write_to_file
from MakerConfig
or TakerConfig
for the directory server (unless I implement a common trait), we introduced update_directory_config
specifically for the directory server.Testing:
Attention: Patch coverage is 97.56098%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 79.83%. Comparing base (
54b9299
) to head (20f900f
). Report is 32 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
src/market/directory.rs | 93.33% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Shourya742: Regarding:
I noticed that we are still using the method from the utility.
Here we have concluded to use the utill method only, renaming it as write_toml_to_file()
@Shourya742: Regarding:
I noticed that we are still using the method from the utility.
Here we have concluded to use the utill method only, renaming it as
write_toml_to_file()
What I'm suggesting is to associate a write_to_toml
method with the directory config. This would make our implementation consistent across all config structs, eliminating the need for a separate TOML utility, as I don't see any other use case for it.
I say would its okay for now, and add that when the need arises. It will arise when we separate the crates. But its very far away in the roadmap. In the meantime I would prefer to reduce duplicate code. So a single util method for toml writing makes sense. And who knows, by that far in future, we might find more usecase for it.
It will also not be just the toml utility. Many other things will need to be localised. We will have to refactor through all of that. Lets not burden ourselves now on stuffs that far away in future. We do it when we do it. Till then better to keep architecture as per single crate design.
Oh wait. We are already duplicating the code. We should just use the write_toml_to_file
util everywhere. Or makes sense to just remove it and inline the function. Its just few lines.
@Shourya742, @mojoX911:
Upto you. I don't have strong opinion on either.
I think I will go with inlining it in the directory.rs
file -- which means removing the write_toml_to_file()
completely since it was only being used there.
Reason being I have a few ideas for writing the configs of maker, taker
and directory
as I am thinking of implementing a trait (but in another PR) for writing configs that can be used in all three structs (MakerConfig
, TakerConfig
and DirectoryServer
) and more structs if needed. That will reduce a lot of code.
Maker config parameters like
port
,rpc_port
,socks_port
,connection_type
when updated with new values, does NOT reflect in theconfig.toml
file. This PR aims to fix that.