Releases: gobanos/cargo-aoc
Version 0.3.7
Fix reqwest feature, thanks to @darin-costello
Version 0.3.6
Fix credentials setting snippet in readme by @williammartin
Use rustls feature for reqwest by @NilsIrl
Adjust error message with the current signature
Split generator bench on each part
Version 0.3.5
Version 0.3.4
Fix GHSA-9qwg-crg9-m2vc
Fix GHSA-6hcf-g6gr-hhcr
Fix GHSA-3gxf-9r58-2ghg
Bump a few other deps
Version 0.3.3
Add custom user agent (closes #88)
Bump a few deps
Version 0.3.2
Backport #44
cargo-aoc 0.2.0
Summary
Generators & Runners now support Result
s and Option
s in return position.
You can benchmark generators too, using cargo aoc bench -g
.
Input is automatically trimmed.
aoc-runner-derive
no longer flood your doc !
Setup
In your Cargo.toml:
aoc-runner = "0.2.0"
aoc-runner-derive = "0.2.0"
In your terminal:
$ cargo install cargo-aoc --force --version 0.2.0
Examples
#[aoc_generator(day1)]
fn parse_input(input: &str) -> Result<Vec<i32>, ParseIntError> {
input
.lines()
.map(|l| l.parse())
.collect()
}
#[aoc(day1, part1)]
fn part1(freqs: &[i32]) -> i32 {
freqs.iter().sum()
}
Known limitation
By far, the biggest limitation is that I need the return type to be called Result
(it still can be prefixed with a path), with at least a template parameter.
So these wont work :
type MyRes = Result<Vec<i32>, ParseIntError>;
#[aoc_generator(day1)]
fn parse_input(input: &str) -> MyRes {
...
}
type Result = std::result::Result<Vec<i32>, ParseIntError>;
#[aoc_generator(day1)]
fn parse_input(input: &str) -> MyRes {
...
}