Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes issue #11.
Summary
This PR adds the ability to save results to a file via the
-r
flag. In the current implementation results are not saved by default, instead the user must pass either the new-r
flag and a path or set theTOIPE_RESULTS_FILE
environment variable to a file path.Notes
The only thing that we might want to modify is the error type being returned by the
save_results
function I've added. I do not useToipeError
and instead fall back onstd::io::Error
which gets unrolled up where it is then turned intoToipeError
, but in doing so the error information is dropped. See here for thesave_results
function and here for how I'm taking the error in and returningToipeError
.Let me know what suggestions you have and I'll be happy to make any relevant modifications. I'm not the biggest Rust guy, so I may have missed more idiomatic patterns that would improve this PR.