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

Extract printing behaviour into a report or summary method with a default implementation #4

Open
drmason13 opened this issue May 8, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@drmason13
Copy link
Owner

Currently this is done inline in the run method.

// TODO: extract printing behaviour into a report or summary method with a default implementation
println!(
    "Day {0}, Part 1\n\
    {1}\n\n\
    Day {0}, Part 1\n\
    {2}",
    Day, part1_output, part2_output
);

I can foresee plenty of reasons to want to customise this and I'd like to enable that more easily.

Separating into two methods means the user can do that without having to re-implement the running of part1 and part2 which is a bit more involved..

@drmason13
Copy link
Owner Author

Oh I should fix that it prints "Part 1" both times, yikes!

@drmason13 drmason13 added enhancement New feature or request good first issue Good for newcomers labels May 8, 2021
drmason13 added a commit that referenced this issue May 8, 2021
drmason13 added a commit that referenced this issue May 9, 2021
report handles the "reporting" of the results, e.g. printing to stdout.
relates to #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant