gobanos / cargo-aoc

452 stars 48 forks source link

Input is stripping leading whitespace #21

Closed lilyball closed 5 years ago

lilyball commented 5 years ago

I'm running into issues with day13 and it appears that the input that cargo-aoc is giving me is stripping all leading whitespace from the first line. The actual first line of my input/2018/day13.txt file is

                    /--------------------------------------------------\                                        /----------------\                    

but the line that cargo-aoc is giving me as input is

/--------------------------------------------------\                                        /----------------\                    
lilyball commented 5 years ago

I think it's also trimming trailing whitespace on the last line.

gobanos commented 5 years ago

I've published aoc-runner 0.2.2 to solve this issue.

I moved from trim() to trim_end_matches('\n'), to prevent trimming white space on last line too.

You have to update cargo-aoc to 0.2.2 too (I'll open an issue for that)

lilyball commented 5 years ago

Looks like aoc-runner-derive is still version 0.2.1. I assumed it should always match the version of aoc-runner. Is this an oversight or were you not actually trying to maintain version equality?

gobanos commented 5 years ago

No update was needed on aoc-runner-derive this time. I want to be more flexible with version, especially between aoc-runner & cargo-aoc. Do you think I should bump the aoc-runner-derive version to match aoc-runner ?

lilyball commented 5 years ago

Given that the various crates need to stay in sync with each other, I think it's helpful to actually keep the versions the same. Otherwise if I'm using anything besides the latest version of aoc-runner, how do I know what versions of aoc-runner-derive and cargo-aoc to use?

gobanos commented 5 years ago

cargo-aoc uses aoc-runner public API (and aoc-runner-derive identifiers), which should be stable now. So keeping crates on the same minor version should be enough. I suggest to follow this discussion on #22.