-
Notifications
You must be signed in to change notification settings - Fork 127
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
Allow pretty ser to work with implicit-some extension #182
Conversation
Additionally configure newline for tests to work on windows
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.
Thank you for the PR!
src/ser/mod.rs
Outdated
@@ -112,6 +96,8 @@ pub struct PrettyConfig { | |||
/// Enumerate array items in comments | |||
#[serde(default = "default_enumerate_arrays")] | |||
pub enumerate_arrays: bool, | |||
/// Enable implicit_some extension | |||
pub implicit_some: bool, |
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.
We would potentially want other features there as well. Let's make it a bitflags field to account for future needs?
We could move the struct_names
in these flags too, sometimes later.
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.
Sure. I'm going to be busy for the next week, but I'll try to get to it after that.
Sorry for the delay-- I factored out the Extensions from |
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.
This is looking great, thank you!
Just one small nit I got
src/ser/mod.rs
Outdated
@@ -207,6 +208,7 @@ impl Default for PrettyConfig { | |||
indentor: default_indentor(), | |||
separate_tuple_members: default_separate_tuple_members(), | |||
enumerate_arrays: default_enumerate_arrays(), | |||
extensions: default_extensions(), |
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.
should probably just use Extensions::default()
here
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.
ah, good point. will fix that right up.
bors r+ |
182: Allow pretty ser to work with implicit-some extension r=kvark a=cmaher Additionally configure newline for tests to work on windows. I was converting my yaml files to ron and needed this, so I figured I'd submit a PR. Really enjoying RON as a data language, btw! Co-authored-by: Christian Maher <[email protected]>
Build succeeded |
Additionally configure newline for tests to work on windows.
I was converting my yaml files to ron and needed this, so I figured I'd submit a PR. Really enjoying RON as a data language, btw!