-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Revamp config code #287
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
Revamp config code #287
Conversation
3cf3d20
to
c9dfd1e
Compare
Ok, this PR is ready for review. I have implemented all the things from #285
|
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.
just skimmed this, everything seems fine to me 👌
src/book/mod.rs
Outdated
} | ||
|
||
/* | ||
pub fn set_author(mut self, author: &str) -> Self { |
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.
do we still need these methods?
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.
get and set author?
No, we can remove them. I would like to remove the other methods as well and provide a better way to access the configuration, but they are too pervasively used throughout the code and a little to ambitious for this PR.
Thanks! Let's wait to see if Steve wants to have a look before we merge :) |
Hi, I was thinking about removing duplication of fields between I'll wait until this gets merged and dust settles before making any proposals. |
Oh yes, that would be a good refactor, when making this PR it was pretty painfull to update all the getters everywhere. Actually now I think It's pretty safe to say that this PR is going to land soon without much changes. I'm just waiting to see if @steveklabnik wants to have a look before we do. |
My thoughts exactly :) |
…eprecation period
Yup! 👍 |
This is a rewrite of the configuration code for the TOML configuration push #285
The JSON configuration should remain unchanged, but is deprecated. Unless we want to support both?
The supported TOML format has been changed to the following:
I have also added tests for each key, both in TOML and JSON.
The other files that use the configs have only gotten changes necessary to compile and work. But by going through the code for the changes I realised how ugly my code is... 😄 I think changing the rest is out of scope for this PR, but there is a lot of opportunity for clean-ups.
Closes #285, closes #178, closes #240 and improves the test coverage.