Skip to content
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

JSON Export Reapply #45

Merged
merged 1 commit into from
Mar 20, 2018
Merged

JSON Export Reapply #45

merged 1 commit into from
Mar 20, 2018

Conversation

stevepentland
Copy link
Contributor

@stevepentland stevepentland commented Mar 19, 2018

Replaces #43, and relates to #42, fixup the commits and clean up some comments

No longer serialize into strings, instead use Vec<u8> as it is
what we're writing to the files.

Fixup comments
This was referenced Mar 19, 2018
@@ -51,16 +54,19 @@ impl ExportEntry {

/// The ResultExportType enum is used to denote the desired form
/// of exporter to use for a given file.
#[derive(Clone)]
pub enum ResultExportType {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe consider using this enum just to track the type of export and pass the file path as a separate argument? Just a thought.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, as I was looking at it, these two pieces of data are intrinsically linked to one-another. I didn't really see any benefit in breaking them apart, just to have to bring them back together or store the file name somewhere else. However, I just noticed that there is no reason to derive clone on this type and it can safely be removed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #46

csv_file: Option<&'a str>,
}

fn create_exporter(targets: ExportTargetList) -> Option<ExportManager> {
Copy link
Owner

@sharkdp sharkdp Mar 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have an idea of how to refactor this slightly, but I can do that in a separate PR. I will add you as a reviewer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this was next on my list, after I brought the markdown branch into PR scope

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #46

@sharkdp
Copy link
Owner

sharkdp commented Mar 20, 2018

Great stuff! Thank you very much (again).

@sharkdp sharkdp merged commit c59110d into sharkdp:master Mar 20, 2018
@stevepentland stevepentland deleted the reapply-json branch March 20, 2018 20:31
@sharkdp sharkdp mentioned this pull request Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants