diff --git a/.aoc_tiles/tiles/2023/01.png b/.aoc_tiles/tiles/2023/01.png index 0e5d690..165bc2d 100644 Binary files a/.aoc_tiles/tiles/2023/01.png and b/.aoc_tiles/tiles/2023/01.png differ diff --git a/.aoc_tiles/tiles/2023/02.png b/.aoc_tiles/tiles/2023/02.png index ee81ffe..c6c86a0 100644 Binary files a/.aoc_tiles/tiles/2023/02.png and b/.aoc_tiles/tiles/2023/02.png differ diff --git a/.aoc_tiles/tiles/2023/03.png b/.aoc_tiles/tiles/2023/03.png index 96c0a4f..10266f2 100644 Binary files a/.aoc_tiles/tiles/2023/03.png and b/.aoc_tiles/tiles/2023/03.png differ diff --git a/.aoc_tiles/tiles/2023/04.png b/.aoc_tiles/tiles/2023/04.png index ab40e83..cfbeca5 100644 Binary files a/.aoc_tiles/tiles/2023/04.png and b/.aoc_tiles/tiles/2023/04.png differ diff --git a/.aoc_tiles/tiles/2023/05.png b/.aoc_tiles/tiles/2023/05.png index 6572d4e..cd8410d 100644 Binary files a/.aoc_tiles/tiles/2023/05.png and b/.aoc_tiles/tiles/2023/05.png differ diff --git a/.aoc_tiles/tiles/2023/06.png b/.aoc_tiles/tiles/2023/06.png index 9fab610..6399538 100644 Binary files a/.aoc_tiles/tiles/2023/06.png and b/.aoc_tiles/tiles/2023/06.png differ diff --git a/.aoc_tiles/tiles/2023/07.png b/.aoc_tiles/tiles/2023/07.png index 6c926de..dc37077 100644 Binary files a/.aoc_tiles/tiles/2023/07.png and b/.aoc_tiles/tiles/2023/07.png differ diff --git a/.aoc_tiles/tiles/2023/08.png b/.aoc_tiles/tiles/2023/08.png index 6d4a513..f5e34aa 100644 Binary files a/.aoc_tiles/tiles/2023/08.png and b/.aoc_tiles/tiles/2023/08.png differ diff --git a/.aoc_tiles/tiles/2023/09.png b/.aoc_tiles/tiles/2023/09.png index 871a899..b1319c0 100644 Binary files a/.aoc_tiles/tiles/2023/09.png and b/.aoc_tiles/tiles/2023/09.png differ diff --git a/.aoc_tiles/tiles/2023/10.png b/.aoc_tiles/tiles/2023/10.png index 6138755..e216a6a 100644 Binary files a/.aoc_tiles/tiles/2023/10.png and b/.aoc_tiles/tiles/2023/10.png differ diff --git a/.aoc_tiles/tiles/2023/11.png b/.aoc_tiles/tiles/2023/11.png index efcde3f..116a330 100644 Binary files a/.aoc_tiles/tiles/2023/11.png and b/.aoc_tiles/tiles/2023/11.png differ diff --git a/.aoc_tiles/tiles/2023/12.png b/.aoc_tiles/tiles/2023/12.png index 1e07c75..e7df7fb 100644 Binary files a/.aoc_tiles/tiles/2023/12.png and b/.aoc_tiles/tiles/2023/12.png differ diff --git a/.aoc_tiles/tiles/2023/13.png b/.aoc_tiles/tiles/2023/13.png index 8eddb0f..e4e0a0d 100644 Binary files a/.aoc_tiles/tiles/2023/13.png and b/.aoc_tiles/tiles/2023/13.png differ diff --git a/.aoc_tiles/tiles/2023/14.png b/.aoc_tiles/tiles/2023/14.png index 8226b7f..3a0dbab 100644 Binary files a/.aoc_tiles/tiles/2023/14.png and b/.aoc_tiles/tiles/2023/14.png differ diff --git a/.aoc_tiles/tiles/2023/15.png b/.aoc_tiles/tiles/2023/15.png index 6a67c41..445576d 100644 Binary files a/.aoc_tiles/tiles/2023/15.png and b/.aoc_tiles/tiles/2023/15.png differ diff --git a/.aoc_tiles/tiles/2023/16.png b/.aoc_tiles/tiles/2023/16.png index b81a557..e2408e2 100644 Binary files a/.aoc_tiles/tiles/2023/16.png and b/.aoc_tiles/tiles/2023/16.png differ diff --git a/.aoc_tiles/tiles/2023/17.png b/.aoc_tiles/tiles/2023/17.png index 0b18a76..7bc830f 100644 Binary files a/.aoc_tiles/tiles/2023/17.png and b/.aoc_tiles/tiles/2023/17.png differ diff --git a/.aoc_tiles/tiles/2023/18.png b/.aoc_tiles/tiles/2023/18.png index 6a1ef26..ebf34fb 100644 Binary files a/.aoc_tiles/tiles/2023/18.png and b/.aoc_tiles/tiles/2023/18.png differ diff --git a/.aoc_tiles/tiles/2023/19.png b/.aoc_tiles/tiles/2023/19.png index ffea468..667e460 100644 Binary files a/.aoc_tiles/tiles/2023/19.png and b/.aoc_tiles/tiles/2023/19.png differ diff --git a/.aoc_tiles/tiles/2023/20.png b/.aoc_tiles/tiles/2023/20.png index 2e1b734..f19a1b8 100644 Binary files a/.aoc_tiles/tiles/2023/20.png and b/.aoc_tiles/tiles/2023/20.png differ diff --git a/.aoc_tiles/tiles/2023/21.png b/.aoc_tiles/tiles/2023/21.png index b9a9daf..049bc6b 100644 Binary files a/.aoc_tiles/tiles/2023/21.png and b/.aoc_tiles/tiles/2023/21.png differ diff --git a/.aoc_tiles/tiles/2023/22.png b/.aoc_tiles/tiles/2023/22.png index 40002ad..f20e00e 100644 Binary files a/.aoc_tiles/tiles/2023/22.png and b/.aoc_tiles/tiles/2023/22.png differ diff --git a/.aoc_tiles/tiles/2023/23.png b/.aoc_tiles/tiles/2023/23.png index a6795de..7091eef 100644 Binary files a/.aoc_tiles/tiles/2023/23.png and b/.aoc_tiles/tiles/2023/23.png differ diff --git a/.aoc_tiles/tiles/2023/24.png b/.aoc_tiles/tiles/2023/24.png index f054fb6..eecba6c 100644 Binary files a/.aoc_tiles/tiles/2023/24.png and b/.aoc_tiles/tiles/2023/24.png differ diff --git a/.aoc_tiles/tiles/2023/25.png b/.aoc_tiles/tiles/2023/25.png index 2c4e815..9fe016e 100644 Binary files a/.aoc_tiles/tiles/2023/25.png and b/.aoc_tiles/tiles/2023/25.png differ diff --git a/.aoc_tiles/tiles/2024/01.png b/.aoc_tiles/tiles/2024/01.png index e106b73..ada1270 100644 Binary files a/.aoc_tiles/tiles/2024/01.png and b/.aoc_tiles/tiles/2024/01.png differ diff --git a/.aoc_tiles/tiles/2024/02.png b/.aoc_tiles/tiles/2024/02.png index 8bab50d..3ee0952 100644 Binary files a/.aoc_tiles/tiles/2024/02.png and b/.aoc_tiles/tiles/2024/02.png differ diff --git a/.aoc_tiles/tiles/2024/03.png b/.aoc_tiles/tiles/2024/03.png index 54277fb..5b345a6 100644 Binary files a/.aoc_tiles/tiles/2024/03.png and b/.aoc_tiles/tiles/2024/03.png differ diff --git a/.aoc_tiles/tiles/2024/04.png b/.aoc_tiles/tiles/2024/04.png index 489e849..648716c 100644 Binary files a/.aoc_tiles/tiles/2024/04.png and b/.aoc_tiles/tiles/2024/04.png differ diff --git a/.aoc_tiles/tiles/2024/05.png b/.aoc_tiles/tiles/2024/05.png index e2d29b3..b1b0f32 100644 Binary files a/.aoc_tiles/tiles/2024/05.png and b/.aoc_tiles/tiles/2024/05.png differ diff --git a/.aoc_tiles/tiles/2024/06.png b/.aoc_tiles/tiles/2024/06.png index 04ec642..9c20d7b 100644 Binary files a/.aoc_tiles/tiles/2024/06.png and b/.aoc_tiles/tiles/2024/06.png differ diff --git a/.aoc_tiles/tiles/2024/07.png b/.aoc_tiles/tiles/2024/07.png index d748761..9fea9f8 100644 Binary files a/.aoc_tiles/tiles/2024/07.png and b/.aoc_tiles/tiles/2024/07.png differ diff --git a/.aoc_tiles/tiles/2024/08.png b/.aoc_tiles/tiles/2024/08.png index 062922e..78b9352 100644 Binary files a/.aoc_tiles/tiles/2024/08.png and b/.aoc_tiles/tiles/2024/08.png differ diff --git a/.aoc_tiles/tiles/2024/09.png b/.aoc_tiles/tiles/2024/09.png index 63189e2..8dda323 100644 Binary files a/.aoc_tiles/tiles/2024/09.png and b/.aoc_tiles/tiles/2024/09.png differ diff --git a/.aoc_tiles/tiles/2024/11.png b/.aoc_tiles/tiles/2024/11.png index a122450..1b44144 100644 Binary files a/.aoc_tiles/tiles/2024/11.png and b/.aoc_tiles/tiles/2024/11.png differ diff --git a/.aoc_tiles/tiles/2024/12.png b/.aoc_tiles/tiles/2024/12.png index af08c81..8989329 100644 Binary files a/.aoc_tiles/tiles/2024/12.png and b/.aoc_tiles/tiles/2024/12.png differ diff --git a/.aoc_tiles/tiles/2024/13.png b/.aoc_tiles/tiles/2024/13.png index 09a2aa7..a014355 100644 Binary files a/.aoc_tiles/tiles/2024/13.png and b/.aoc_tiles/tiles/2024/13.png differ diff --git a/.aoc_tiles/tiles/2024/14.png b/.aoc_tiles/tiles/2024/14.png index 76ebe38..e4f0551 100644 Binary files a/.aoc_tiles/tiles/2024/14.png and b/.aoc_tiles/tiles/2024/14.png differ diff --git a/.aoc_tiles/tiles/2024/15.png b/.aoc_tiles/tiles/2024/15.png index fbb1b82..8a0a40a 100644 Binary files a/.aoc_tiles/tiles/2024/15.png and b/.aoc_tiles/tiles/2024/15.png differ diff --git a/.aoc_tiles/tiles/2024/16.png b/.aoc_tiles/tiles/2024/16.png index 80b37d7..2e96a98 100644 Binary files a/.aoc_tiles/tiles/2024/16.png and b/.aoc_tiles/tiles/2024/16.png differ diff --git a/.aoc_tiles/tiles/2024/17.png b/.aoc_tiles/tiles/2024/17.png index c2f05f3..7606912 100644 Binary files a/.aoc_tiles/tiles/2024/17.png and b/.aoc_tiles/tiles/2024/17.png differ diff --git a/.aoc_tiles/tiles/2024/19.png b/.aoc_tiles/tiles/2024/19.png index 61babe3..9da34f0 100644 Binary files a/.aoc_tiles/tiles/2024/19.png and b/.aoc_tiles/tiles/2024/19.png differ diff --git a/.aoc_tiles/tiles/2024/20.png b/.aoc_tiles/tiles/2024/20.png index d75374e..5d13312 100644 Binary files a/.aoc_tiles/tiles/2024/20.png and b/.aoc_tiles/tiles/2024/20.png differ diff --git a/.aoc_tiles/tiles/2024/21.png b/.aoc_tiles/tiles/2024/21.png index dda1649..81f87fc 100644 Binary files a/.aoc_tiles/tiles/2024/21.png and b/.aoc_tiles/tiles/2024/21.png differ diff --git a/.aoc_tiles/tiles/2024/22.png b/.aoc_tiles/tiles/2024/22.png index da7f049..56fdee5 100644 Binary files a/.aoc_tiles/tiles/2024/22.png and b/.aoc_tiles/tiles/2024/22.png differ diff --git a/.aoc_tiles/tiles/2024/23.png b/.aoc_tiles/tiles/2024/23.png index 37a2549..bc4cac9 100644 Binary files a/.aoc_tiles/tiles/2024/23.png and b/.aoc_tiles/tiles/2024/23.png differ diff --git a/.aoc_tiles/tiles/2024/24.png b/.aoc_tiles/tiles/2024/24.png index 892946b..b966019 100644 Binary files a/.aoc_tiles/tiles/2024/24.png and b/.aoc_tiles/tiles/2024/24.png differ diff --git a/.aoc_tiles/tiles/2024/25.png b/.aoc_tiles/tiles/2024/25.png index b6269f1..2eaf083 100644 Binary files a/.aoc_tiles/tiles/2024/25.png and b/.aoc_tiles/tiles/2024/25.png differ diff --git a/.aoc_tiles/tiles/2025/01.png b/.aoc_tiles/tiles/2025/01.png index 476293f..ec38deb 100644 Binary files a/.aoc_tiles/tiles/2025/01.png and b/.aoc_tiles/tiles/2025/01.png differ diff --git a/.aoc_tiles/tiles/2025/02.png b/.aoc_tiles/tiles/2025/02.png index e044013..ab61816 100644 Binary files a/.aoc_tiles/tiles/2025/02.png and b/.aoc_tiles/tiles/2025/02.png differ diff --git a/.aoc_tiles/tiles/2025/03.png b/.aoc_tiles/tiles/2025/03.png index d83b302..7376104 100644 Binary files a/.aoc_tiles/tiles/2025/03.png and b/.aoc_tiles/tiles/2025/03.png differ diff --git a/.aoc_tiles/tiles/2025/04.png b/.aoc_tiles/tiles/2025/04.png index 0b2ad35..4a614fa 100644 Binary files a/.aoc_tiles/tiles/2025/04.png and b/.aoc_tiles/tiles/2025/04.png differ diff --git a/.aoc_tiles/tiles/2025/05.png b/.aoc_tiles/tiles/2025/05.png index 709b225..6723ab7 100644 Binary files a/.aoc_tiles/tiles/2025/05.png and b/.aoc_tiles/tiles/2025/05.png differ diff --git a/.aoc_tiles/tiles/2025/06.png b/.aoc_tiles/tiles/2025/06.png index 7625740..e8d999c 100644 Binary files a/.aoc_tiles/tiles/2025/06.png and b/.aoc_tiles/tiles/2025/06.png differ diff --git a/.aoc_tiles/tiles/2025/07.png b/.aoc_tiles/tiles/2025/07.png index 0024a61..3b103b6 100644 Binary files a/.aoc_tiles/tiles/2025/07.png and b/.aoc_tiles/tiles/2025/07.png differ diff --git a/.aoc_tiles/tiles/2025/08.png b/.aoc_tiles/tiles/2025/08.png index 8ca3c05..8c4293a 100644 Binary files a/.aoc_tiles/tiles/2025/08.png and b/.aoc_tiles/tiles/2025/08.png differ diff --git a/.aoc_tiles/tiles/2025/09.png b/.aoc_tiles/tiles/2025/09.png index b914bf7..2e00dc3 100644 Binary files a/.aoc_tiles/tiles/2025/09.png and b/.aoc_tiles/tiles/2025/09.png differ diff --git a/.aoc_tiles/tiles/2025/10.png b/.aoc_tiles/tiles/2025/10.png index 2055f98..60bcc90 100644 Binary files a/.aoc_tiles/tiles/2025/10.png and b/.aoc_tiles/tiles/2025/10.png differ diff --git a/.aoc_tiles/tiles/2025/11.png b/.aoc_tiles/tiles/2025/11.png index b1ad45e..cd962b6 100644 Binary files a/.aoc_tiles/tiles/2025/11.png and b/.aoc_tiles/tiles/2025/11.png differ diff --git a/.aoc_tiles/tiles/2025/12.png b/.aoc_tiles/tiles/2025/12.png index 04efebb..efc17e5 100644 Binary files a/.aoc_tiles/tiles/2025/12.png and b/.aoc_tiles/tiles/2025/12.png differ diff --git a/.aoc_tiles/tiles/2026/01.png b/.aoc_tiles/tiles/2026/01.png index 00742b7..2572c5d 100644 Binary files a/.aoc_tiles/tiles/2026/01.png and b/.aoc_tiles/tiles/2026/01.png differ diff --git a/.aoc_tiles/tiles/2026/02.png b/.aoc_tiles/tiles/2026/02.png index 90ef215..1d73bd4 100644 Binary files a/.aoc_tiles/tiles/2026/02.png and b/.aoc_tiles/tiles/2026/02.png differ diff --git a/2024/.github/workflows/test.yaml b/.github/workflows/test-2024.yaml similarity index 100% rename from 2024/.github/workflows/test.yaml rename to .github/workflows/test-2024.yaml diff --git a/2022/.aoc_tiles/tiles/2022/01.png b/2022/.aoc_tiles/tiles/2022/01.png deleted file mode 100644 index 7266f86..0000000 Binary files a/2022/.aoc_tiles/tiles/2022/01.png and /dev/null differ diff --git a/2022/.aoc_tiles/tiles/2022/02.png b/2022/.aoc_tiles/tiles/2022/02.png deleted file mode 100644 index 2dd639b..0000000 Binary files a/2022/.aoc_tiles/tiles/2022/02.png and /dev/null differ diff --git a/2022/.aoc_tiles/tiles/2022/03.png b/2022/.aoc_tiles/tiles/2022/03.png deleted file mode 100644 index 83eecee..0000000 Binary files a/2022/.aoc_tiles/tiles/2022/03.png and /dev/null differ diff --git a/2022/.aoc_tiles/tiles/2022/04.png b/2022/.aoc_tiles/tiles/2022/04.png deleted file mode 100644 index af65e1c..0000000 Binary files a/2022/.aoc_tiles/tiles/2022/04.png and /dev/null differ diff --git a/2022/.aoc_tiles/tiles/2022/05.png b/2022/.aoc_tiles/tiles/2022/05.png deleted file mode 100644 index 1a42bad..0000000 Binary files a/2022/.aoc_tiles/tiles/2022/05.png and /dev/null differ diff --git a/2022/.aoc_tiles/tiles/2022/06.png b/2022/.aoc_tiles/tiles/2022/06.png deleted file mode 100644 index 2613b93..0000000 Binary files a/2022/.aoc_tiles/tiles/2022/06.png and /dev/null differ diff --git a/2022/.aoc_tiles/tiles/2022/07.png b/2022/.aoc_tiles/tiles/2022/07.png deleted file mode 100644 index 747f727..0000000 Binary files a/2022/.aoc_tiles/tiles/2022/07.png and /dev/null differ diff --git a/2022/.gitignore b/2022/.gitignore deleted file mode 100644 index 2ad0769..0000000 --- a/2022/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -**/target -input -flamegraph.svg -perf.data* -guesses -.aoc_tiles/* -!.aoc_tiles/tiles/ diff --git a/2022/.pre-commit-config.yaml b/2022/.pre-commit-config.yaml deleted file mode 100644 index 677bd11..0000000 --- a/2022/.pre-commit-config.yaml +++ /dev/null @@ -1,32 +0,0 @@ -repos: - - repo: local - hooks: - - id: rust-linting - name: Rust linting - entry: cargo fmt --all -- - pass_filenames: true - types: [file, rust] - language: system - - id: rust-clippy - name: Rust clippy - entry: cargo clippy --lib --all-features --tests -- - pass_filenames: false - types: [file, rust] - language: system - - repo: https://github.com/LiquidFun/aoc_tiles - rev: 0.7.2 - hooks: - - id: aoc-tiles - language: system - # Optionally use these arguments. Auto add tiles to git adds the tiles to git, - # possibly amends your commit by creating the tile images and updating the README. - # Language sorting shows the preference of the order of the languages to use. - # Exclude paterns are globs which can be used to exclude files when creating - # the tiles. See the customization section in the README for more flags. - # Simply remove the comments (#) below for args and the flags you want. - args: - - --auto-add-tiles-to-git=amend - - --overwrite-year=2022 - - --tile-width-px=200 - # - --language-sorting=jl,kt,py,rs - # - --exclude-patterns=2021/*/*.apl,2021/*/*.py,2021/*/*.cpp diff --git a/2022/.rustfmt.toml b/2022/.rustfmt.toml deleted file mode 100644 index 7530651..0000000 --- a/2022/.rustfmt.toml +++ /dev/null @@ -1 +0,0 @@ -max_width = 120 diff --git a/2022/README.md b/2022/README.md deleted file mode 100644 index 177eeef..0000000 --- a/2022/README.md +++ /dev/null @@ -1,26 +0,0 @@ - -

- 2022 - 14 ⭐ - Rust -

- - - - - - - - - - - - - - - - - - - - - - diff --git a/2023/.gitignore b/2023/.gitignore deleted file mode 100644 index a7518e3..0000000 --- a/2023/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -**/target -input diff --git a/2024/.aoc_tiles/tiles/2024/01.png b/2024/.aoc_tiles/tiles/2024/01.png deleted file mode 100644 index ada1270..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/01.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/02.png b/2024/.aoc_tiles/tiles/2024/02.png deleted file mode 100644 index 3ee0952..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/02.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/03.png b/2024/.aoc_tiles/tiles/2024/03.png deleted file mode 100644 index 5b345a6..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/03.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/04.png b/2024/.aoc_tiles/tiles/2024/04.png deleted file mode 100644 index 648716c..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/04.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/05.png b/2024/.aoc_tiles/tiles/2024/05.png deleted file mode 100644 index b1b0f32..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/05.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/06.png b/2024/.aoc_tiles/tiles/2024/06.png deleted file mode 100644 index 9c20d7b..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/06.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/07.png b/2024/.aoc_tiles/tiles/2024/07.png deleted file mode 100644 index 9fea9f8..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/07.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/08.png b/2024/.aoc_tiles/tiles/2024/08.png deleted file mode 100644 index 78b9352..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/08.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/09.png b/2024/.aoc_tiles/tiles/2024/09.png deleted file mode 100644 index 8dda323..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/09.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/10.png b/2024/.aoc_tiles/tiles/2024/10.png deleted file mode 100644 index 71d23e4..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/10.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/11.png b/2024/.aoc_tiles/tiles/2024/11.png deleted file mode 100644 index 1b44144..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/11.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/12.png b/2024/.aoc_tiles/tiles/2024/12.png deleted file mode 100644 index 8989329..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/12.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/13.png b/2024/.aoc_tiles/tiles/2024/13.png deleted file mode 100644 index a014355..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/13.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/14.png b/2024/.aoc_tiles/tiles/2024/14.png deleted file mode 100644 index e4f0551..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/14.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/15.png b/2024/.aoc_tiles/tiles/2024/15.png deleted file mode 100644 index 8a0a40a..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/15.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/16.png b/2024/.aoc_tiles/tiles/2024/16.png deleted file mode 100644 index 2e96a98..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/16.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/17.png b/2024/.aoc_tiles/tiles/2024/17.png deleted file mode 100644 index 7606912..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/17.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/18.png b/2024/.aoc_tiles/tiles/2024/18.png deleted file mode 100644 index 9e04ed3..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/18.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/19.png b/2024/.aoc_tiles/tiles/2024/19.png deleted file mode 100644 index 9da34f0..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/19.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/20.png b/2024/.aoc_tiles/tiles/2024/20.png deleted file mode 100644 index 5d13312..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/20.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/21.png b/2024/.aoc_tiles/tiles/2024/21.png deleted file mode 100644 index 007aeb9..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/21.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/22.png b/2024/.aoc_tiles/tiles/2024/22.png deleted file mode 100644 index 56fdee5..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/22.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/23.png b/2024/.aoc_tiles/tiles/2024/23.png deleted file mode 100644 index bc4cac9..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/23.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/24.png b/2024/.aoc_tiles/tiles/2024/24.png deleted file mode 100644 index b966019..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/24.png and /dev/null differ diff --git a/2024/.aoc_tiles/tiles/2024/25.png b/2024/.aoc_tiles/tiles/2024/25.png deleted file mode 100644 index a1daeb8..0000000 Binary files a/2024/.aoc_tiles/tiles/2024/25.png and /dev/null differ diff --git a/2024/.gitignore b/2024/.gitignore deleted file mode 100644 index 2ad0769..0000000 --- a/2024/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -**/target -input -flamegraph.svg -perf.data* -guesses -.aoc_tiles/* -!.aoc_tiles/tiles/ diff --git a/2024/.pre-commit-config.yaml b/2024/.pre-commit-config.yaml deleted file mode 100644 index 8dd37bf..0000000 --- a/2024/.pre-commit-config.yaml +++ /dev/null @@ -1,30 +0,0 @@ -repos: - - repo: local - hooks: - - id: rust-linting - name: Rust linting - entry: cargo fmt --all -- - pass_filenames: true - types: [file, rust] - language: system - - id: rust-clippy - name: Rust clippy - entry: cargo clippy --lib --all-features --tests -- -D warnings - pass_filenames: false - types: [file, rust] - language: system - - repo: https://github.com/LiquidFun/aoc_tiles - rev: 0.6.2 - hooks: - - id: aoc-tiles - # Optionally use these arguments. Auto add tiles to git adds the tiles to git, - # possibly amends your commit by creating the tile images and updating the README. - # Language sorting shows the preference of the order of the languages to use. - # Exclude paterns are globs which can be used to exclude files when creating - # the tiles. See the customization section in the README for more flags. - # Simply remove the comments (#) below for args and the flags you want. - args: - - --auto-add-tiles-to-git=amend - - --overwrite-year=2024 - # - --language-sorting=jl,kt,py,rs - # - --exclude-patterns=2021/*/*.apl,2021/*/*.py,2021/*/*.cpp diff --git a/2024/.rustfmt.toml b/2024/.rustfmt.toml deleted file mode 100644 index 7530651..0000000 --- a/2024/.rustfmt.toml +++ /dev/null @@ -1 +0,0 @@ -max_width = 120 diff --git a/2024/README.md b/2024/README.md deleted file mode 100644 index dfc7c92..0000000 --- a/2024/README.md +++ /dev/null @@ -1,80 +0,0 @@ - -

- 2024 - 48 ⭐ - Rust -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/2025/.aoc_tiles/tiles/2025/01.png b/2025/.aoc_tiles/tiles/2025/01.png deleted file mode 100644 index ec38deb..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/01.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/02.png b/2025/.aoc_tiles/tiles/2025/02.png deleted file mode 100644 index ab61816..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/02.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/03.png b/2025/.aoc_tiles/tiles/2025/03.png deleted file mode 100644 index 7376104..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/03.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/04.png b/2025/.aoc_tiles/tiles/2025/04.png deleted file mode 100644 index 4a614fa..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/04.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/05.png b/2025/.aoc_tiles/tiles/2025/05.png deleted file mode 100644 index 6723ab7..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/05.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/06.png b/2025/.aoc_tiles/tiles/2025/06.png deleted file mode 100644 index e8d999c..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/06.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/07.png b/2025/.aoc_tiles/tiles/2025/07.png deleted file mode 100644 index 3b103b6..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/07.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/08.png b/2025/.aoc_tiles/tiles/2025/08.png deleted file mode 100644 index 8c4293a..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/08.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/09.png b/2025/.aoc_tiles/tiles/2025/09.png deleted file mode 100644 index 2e00dc3..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/09.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/10.png b/2025/.aoc_tiles/tiles/2025/10.png deleted file mode 100644 index 60bcc90..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/10.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/11.png b/2025/.aoc_tiles/tiles/2025/11.png deleted file mode 100644 index cd962b6..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/11.png and /dev/null differ diff --git a/2025/.aoc_tiles/tiles/2025/12.png b/2025/.aoc_tiles/tiles/2025/12.png deleted file mode 100644 index efc17e5..0000000 Binary files a/2025/.aoc_tiles/tiles/2025/12.png and /dev/null differ diff --git a/2025/.gitignore b/2025/.gitignore deleted file mode 100644 index 2ad0769..0000000 --- a/2025/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -**/target -input -flamegraph.svg -perf.data* -guesses -.aoc_tiles/* -!.aoc_tiles/tiles/ diff --git a/2025/.pre-commit-config.yaml b/2025/.pre-commit-config.yaml deleted file mode 100644 index 5b2a983..0000000 --- a/2025/.pre-commit-config.yaml +++ /dev/null @@ -1,32 +0,0 @@ -repos: - - repo: local - hooks: - - id: rust-linting - name: Rust linting - entry: cargo fmt --all -- - pass_filenames: true - types: [file, rust] - language: system - - id: rust-clippy - name: Rust clippy - entry: cargo clippy --lib --all-features --tests -- - pass_filenames: false - types: [file, rust] - language: system - - repo: https://github.com/LiquidFun/aoc_tiles - rev: 0.7.2 - hooks: - - id: aoc-tiles - language: system - # Optionally use these arguments. Auto add tiles to git adds the tiles to git, - # possibly amends your commit by creating the tile images and updating the README. - # Language sorting shows the preference of the order of the languages to use. - # Exclude paterns are globs which can be used to exclude files when creating - # the tiles. See the customization section in the README for more flags. - # Simply remove the comments (#) below for args and the flags you want. - args: - - --auto-add-tiles-to-git=amend - - --overwrite-year=2025 - - --tile-width-px=200 - # - --language-sorting=jl,kt,py,rs - # - --exclude-patterns=2021/*/*.apl,2021/*/*.py,2021/*/*.cpp diff --git a/2025/README.md b/2025/README.md deleted file mode 100644 index 414bd64..0000000 --- a/2025/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -

- 2025 - 22 ⭐ - Rust -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/2026/.cargo/config.toml b/2026/.cargo/config.toml new file mode 100644 index 0000000..ddff440 --- /dev/null +++ b/2026/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-C", "target-cpu=native"] diff --git a/2026/Cargo.lock b/2026/Cargo.lock new file mode 100644 index 0000000..0578608 --- /dev/null +++ b/2026/Cargo.lock @@ -0,0 +1,1192 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3019c0b8d883a8a17df3129e417ef463c087807d245e8881a31d583dee1c0519" +dependencies = [ + "cfg-if 1.0.5", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57b212daf2e827b1ccdd778b7eb48ba433e58cb0e4f27b43cd6b7a608425a014" + +[[package]] +name = "aoc-runner" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d21ef9204ad206a5a3e918e9920da04e1118ad91ce4f23570be964b9d6b9dfcb" + +[[package]] +name = "aoc-runner-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8b944269d3fee645d281b1335e1797044db497bb02d0098cc3fdb8900069cc" +dependencies = [ + "aoc-runner-internal", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "aoc-runner-internal" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "274b0ba7f3669a45ec0aaacf94eb032a749de880ab776091576cca94037c9982" +dependencies = [ + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "aoc2026" +version = "0.1.0" +dependencies = [ + "aoc-runner", + "aoc-runner-derive", + "cached", + "grid", + "indicatif", + "itertools", + "misc", + "rayon", + "regex", + "rstest", + "rustc_data_structures", + "wide", +] + +[[package]] +name = "arrayvec" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47a64a0fd06e123e9e3cf3ad01432af17dcab8185e8023edcf184fe696f9675d" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "bumpalo" +version = "3.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" + +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" + +[[package]] +name = "cached" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801927ee168e17809ab8901d9f01f700cd7d8d6a6527997fee44e4b0327a253c" +dependencies = [ + "ahash", + "cached_proc_macro", + "cached_proc_macro_types", + "hashbrown 0.15.5", + "once_cell", + "thiserror", + "web-time", +] + +[[package]] +name = "cached_proc_macro" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9225bdcf4e4a9a4c08bf16607908eb2fbf746828d5e0b5e019726dbf6571f201" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "console" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96a4956774c13c126a8b5af4daa79384f4d826534c95a02d76afb39e2ab64e3" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width", + "windows-sys", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.119", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "either" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" + +[[package]] +name = "ena" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabffdaee24bd1bf95c5ef7cec31260444317e72ea56c4c91750e8b7ee58d5f1" +dependencies = [ + "log", +] + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "errno" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-timer" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if 1.0.5", + "js-sys", + "libc", + "r-efi", + "wasm-bindgen", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "grid" +version = "0.1.0" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "rustc-rayon 0.5.1", +] + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown 0.17.2", +] + +[[package]] +name = "indicatif" +version = "0.18.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9433806cd6b4ec1aba79c021c7e4c58fb4c3b9977c085062e611ac929998fb0c" +dependencies = [ + "console", + "portable-atomic", + "rayon", + "unicode-width", + "unit-prefix", + "web-time", +] + +[[package]] +name = "intrusive-collections" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" +dependencies = [ + "memoffset", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" +dependencies = [ + "cfg-if 1.0.5", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memmap2" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "misc" +version = "0.1.0" +dependencies = [ + "intrusive-collections", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if 1.0.5", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752" + +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "regex" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" + +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "rstest" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5a3193c063baaa2a95a33f03035c8a72b83d97a54916055ba22d35ed3839d49" +dependencies = [ + "futures-timer", + "futures-util", + "rstest_macros", +] + +[[package]] +name = "rstest_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c845311f0ff7951c5506121a9ad75aec44d083c31583b2ea5a30bcb0b0abba0" +dependencies = [ + "cfg-if 1.0.5", + "glob", + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "relative-path", + "rustc_version", + "syn 2.0.119", + "unicode-ident", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-rayon" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9974ab223660e61c1b4e7b43b827379df286736ca988308ce7e16f59f2d89246" +dependencies = [ + "crossbeam-deque", + "either", + "rustc-rayon-core 0.3.2", +] + +[[package]] +name = "rustc-rayon" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd9fb077db982d7ceb42a90471e5a69a990b58f71e06f0d8340bb2cf35eb751" +dependencies = [ + "either", + "rustc-rayon-core 0.5.1", +] + +[[package]] +name = "rustc-rayon-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "564bfd27be8db888d0fa76aa4335e7851aaed0c2c11ad1e93aeb9349f6b88500" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + +[[package]] +name = "rustc-rayon-core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f42932dcd3bcbe484b38a3ccf79b7906fac41c02d408b5b1bac26da3416efdb" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rustc_data_structures" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38bae9c6afa27015bcaa2869e03bb111ecf0d0e0edc2da559a91d4057174c9a" +dependencies = [ + "arrayvec", + "bitflags 1.3.2", + "cfg-if 0.1.10", + "ena", + "indexmap 1.9.3", + "jobserver", + "libc", + "memmap2", + "parking_lot", + "rustc-hash", + "rustc-rayon 0.3.2", + "rustc-rayon-core 0.3.2", + "stable_deref_trait", + "tempfile", + "tracing", + "winapi", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" +dependencies = [ + "bitflags 2.13.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "safe_arch" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42c6efa15875e6ecb39ca61fb0b0c1a40b84fac5a5ffe71eef7d1000c8eb3f5f" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59" + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "toml_datetime" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173f25c883cd2176a2d8212155638c0a60d484a9d84546d270866f40f56b6e49" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.21+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88497dab46de5bf343ec66b05c251e48c6213f3e9170c70a70a823f7abe886a4" +dependencies = [ + "indexmap 2.14.2", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.7+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb28d6e049a9766c3bd91a8326e6179f5b132dec87906bb97018ef7a2f3431a" +dependencies = [ + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "unicode-width" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" + +[[package]] +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasm-bindgen" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" +dependencies = [ + "cfg-if 1.0.5", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.10", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wide" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d920ac99c3c8edce110cb8d07dbb324d6d026011dce85b1e9355b70f0adacc4f" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winnow" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.8.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cba8a86aee14fc8cc6c208af60854b3d4ab7185a9a369a12c648faa2716ff42a" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f89bca3b96ceb3cfcb4572790402f977442270d252b9a8504ebc258760c55f94" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/2026/Cargo.toml b/2026/Cargo.toml new file mode 100644 index 0000000..734c717 --- /dev/null +++ b/2026/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "aoc2026" +edition = "2024" +version = "0.1.0" + +[dependencies] +aoc-runner = "0.3.0" +aoc-runner-derive = "0.3.0" +cached = "0.56.0" +grid = {version = "0.1.0", path = "utils/grid"} +indicatif = { version = "0.18.3", features = ["rayon"] } +itertools = "0.14.0" +misc = {path = "utils/misc"} +rayon = "1.11.0" +regex = "1.11.1" +rstest = "0.26.1" +rustc_data_structures = "0.1.2" +wide = "1.0.2" + +[profile.release] +lto = true +opt-level = 3 +overflow-checks = false diff --git a/2026/src/day1.rs b/2026/src/day1.rs new file mode 100644 index 0000000..b580c33 --- /dev/null +++ b/2026/src/day1.rs @@ -0,0 +1,65 @@ +use std::collections::HashMap; + +use aoc_runner_derive::{aoc, aoc_generator}; +use itertools::Itertools; + +#[aoc_generator(day1)] +fn parse(input: &str) -> HashMap { + input.lines().map(|l| l.parse::().unwrap()).counts() +} + +#[aoc(day1, part1)] +pub fn part1(input: &HashMap) -> u64 { + input + .iter() + .sorted_by_key(|(_k, v)| *v) + .rev() + .take(3) + .fold(1, |acc, (k, _v)| acc * k) +} + +#[aoc(day1, part2)] +pub fn part2(input: &HashMap) -> u64 { + input + .iter() + .sorted_by_key(|(_k, v)| *v) + .take(3) + .fold(1, |acc, (k, _v)| acc * k) +} + +#[cfg(test)] +mod tests { + use crate::day1::*; + + const EXAMPLE: &str = "57 +57 +55 +57 +76 +78 +57 +45 +43 +78 +43 +76 +43 +78 +57 +45 +57 +76 +43 +43 +76"; + + #[test] + fn problem1_example() { + assert_eq!(part1(&parse(EXAMPLE)), 186276); + } + + #[test] + fn problem2_example() { + assert_eq!(part2(&parse(EXAMPLE)), 193050); + } +} diff --git a/2026/src/day2.rs b/2026/src/day2.rs new file mode 100644 index 0000000..05608fe --- /dev/null +++ b/2026/src/day2.rs @@ -0,0 +1,88 @@ +use aoc_runner_derive::{aoc, aoc_generator}; +use itertools::Itertools; + +#[aoc_generator(day2)] +fn parse(input: &str) -> Vec { + input + .as_bytes() + .iter() + .map(|i| SEQUENCE.iter().position(|c| c == i).unwrap() as u8) + .collect_vec() +} + +const SEQUENCE: &[u8] = b"roygbv"; + +// The distance required to move forward from start to end +fn move_distance(start: u8, end: u8) -> i64 { + let mut distance = end as i64 - (start as i64 % SEQUENCE.len() as i64); + if distance <= 0 { + distance += SEQUENCE.len() as i64 + }; + distance +} + +#[aoc(day2, part1)] +fn part1(input: &[u8]) -> u64 { + let mut cur_pos = 0i64; + + for i in input { + cur_pos += move_distance((cur_pos % SEQUENCE.len() as i64) as u8, *i); + } + + cur_pos as u64 +} + +#[aoc(day2, part2)] +fn part2(input: &[u8]) -> u64 { + let mut instructions = input.to_owned(); + + // bring same instructions together, but this will minimize the distance between chunks so we need to spread them again + instructions.sort_unstable(); + let mut chunks = instructions.chunk_by(|a, b| a == b).collect_vec(); + let mut final_chunks = Vec::new(); + + // implement a very stupid selection algorithm for chunks. + // we are already sorted so there is probably an optimal way to place them directly. + // maybe alternating once we find the 'pivot' or something. + // but this is plenty fast. + let mut cur_pos = 0; + while !chunks.is_empty() { + let mut candidate = 0; + let mut candidate_dist = move_distance(cur_pos, chunks[candidate][0]); + for (i, chunk) in chunks.iter().enumerate().skip(1) { + let dist = move_distance(cur_pos, chunk[0]); + if dist > candidate_dist { + candidate = i; + candidate_dist = dist; + } + } + cur_pos = chunks[candidate][0]; + final_chunks.push(chunks.remove(candidate)) + } + let final_instructions = final_chunks.into_iter().flatten().copied().collect_vec(); + + part1(&final_instructions) +} + +#[cfg(test)] +mod tests { + use rstest::rstest; + + use super::*; + + #[rstest] + #[case("roygbv", 11)] + #[case("vbgyor", 30)] + #[case("vvvvvv", 35)] + fn part1_example(#[case] input: &str, #[case] expected: u64) { + assert_eq!(part1(&parse(input)), expected); + } + + #[rstest] + #[case("vrvbvg", 33)] + #[case("groovyyoyo", 55)] + #[case("roygbvroygbvroygbv", 103)] + fn part2_example(#[case] input: &str, #[case] expected: u64) { + assert_eq!(part2(&parse(input)), expected); + } +} diff --git a/2026/src/lib.rs b/2026/src/lib.rs new file mode 100644 index 0000000..b498953 --- /dev/null +++ b/2026/src/lib.rs @@ -0,0 +1,6 @@ +mod day1; +mod day2; + +use aoc_runner_derive::aoc_lib; + +aoc_lib! { year = 2026 } diff --git a/2026/src/main.rs b/2026/src/main.rs new file mode 100644 index 0000000..e17ca90 --- /dev/null +++ b/2026/src/main.rs @@ -0,0 +1,3 @@ +use aoc_runner_derive::aoc_main; + +aoc_main! { lib = aoc2026 } diff --git a/2026/utils/grid/Cargo.lock b/2026/utils/grid/Cargo.lock new file mode 100644 index 0000000..1c1a197 --- /dev/null +++ b/2026/utils/grid/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "grid" +version = "0.1.0" diff --git a/2026/utils/grid/Cargo.toml b/2026/utils/grid/Cargo.toml new file mode 100644 index 0000000..a95c55e --- /dev/null +++ b/2026/utils/grid/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "grid" +version = "0.1.0" +edition = "2024" + +[dependencies] + +[lib] +path = "lib.rs" diff --git a/2026/utils/grid/lib.rs b/2026/utils/grid/lib.rs new file mode 100644 index 0000000..69205ad --- /dev/null +++ b/2026/utils/grid/lib.rs @@ -0,0 +1,797 @@ +use std::{ + fmt::{Debug, Display, Formatter, Write}, + io::{BufRead, Cursor}, + iter::repeat_n, + mem::swap, + ops::{Add, AddAssign, Sub}, + str::FromStr, +}; + +/// NW, N, NE, W, E, SW, S, SE +pub const ADJACENT_OFFSETS: [&(i64, i64); 8] = [ + &(-1, -1), + &(0, -1), + &(1, -1), + &(-1, 0), + &(1, 0), + &(-1, 1), + &(0, 1), + &(1, 1), +]; + +/// NESW +pub const CARDINAL_OFFSETS: [&(i64, i64); 4] = [&(0, -1), &(-1, 0), &(1, 0), &(0, 1)]; + +pub enum MirrorAxis { + X, + Y, +} + +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] +pub struct Coord2d { + pub x: i64, + pub y: i64, +} + +impl Display for Coord2d { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_fmt(format_args!("({}, {})", self.x, self.y)) + } +} + +impl FromStr for Coord2d { + type Err = Box; + fn from_str(s: &str) -> Result { + let (l, r) = s.split_once(',').ok_or("Can't split on ,")?; + Ok(Coord2d { + x: l.parse()?, + y: r.parse()?, + }) + } +} + +pub trait AsCoord2d { + fn to_coord(self) -> Coord2d; + fn x(&self) -> i64; + fn y(&self) -> i64; + + fn manhattan(&self, other: &T) -> u64 { + self.x().abs_diff(other.x()) + self.y().abs_diff(other.y()) + } +} + +impl Sub for &Coord2d { + type Output = Coord2d; + fn sub(self, rhs: T) -> Self::Output { + Coord2d { + x: self.x() - rhs.x(), + y: self.y() - rhs.y(), + } + } +} + +impl Add for &Coord2d +where + T: Copy, +{ + type Output = Coord2d; + fn add(self, rhs: T) -> Self::Output { + Coord2d { + x: self.x() + rhs.x(), + y: self.y() + rhs.y(), + } + } +} + +impl Add<&T> for Coord2d { + type Output = Coord2d; + fn add(self, rhs: &T) -> Self::Output { + Coord2d { + x: self.x() + rhs.x(), + y: self.y() + rhs.y(), + } + } +} + +impl AsCoord2d for Coord2d { + fn to_coord(self) -> Coord2d { + self + } + fn x(&self) -> i64 { + self.x + } + fn y(&self) -> i64 { + self.y + } +} + +impl AsCoord2d for &Coord2d { + fn to_coord(self) -> Coord2d { + self.to_owned() + } + fn x(&self) -> i64 { + self.x + } + fn y(&self) -> i64 { + self.y + } +} + +impl AsCoord2d for (T, T) +where + T: Copy + TryInto, + >::Error: Debug, +{ + fn to_coord(self) -> Coord2d { + Coord2d { + x: self.0.try_into().unwrap(), + y: self.1.try_into().unwrap(), + } + } + fn x(&self) -> i64 { + self.0.try_into().unwrap() + } + fn y(&self) -> i64 { + self.1.try_into().unwrap() + } +} + +impl AsCoord2d for &(T, T) +where + T: Copy + TryInto, + >::Error: Debug, +{ + fn to_coord(self) -> Coord2d { + Coord2d { + x: self.0.try_into().unwrap(), + y: self.1.try_into().unwrap(), + } + } + fn x(&self) -> i64 { + self.0.try_into().unwrap() + } + fn y(&self) -> i64 { + self.1.try_into().unwrap() + } +} + +impl From for (i64, i64) { + fn from(value: Coord2d) -> Self { + (value.x, value.y) + } +} + +#[derive(Debug)] +pub struct GridRowIter<'a, T> { + iter: std::slice::Iter<'a, T>, +} + +impl<'a, T: Clone + Eq + PartialEq + Debug> GridRowIter<'a, T> { + fn new(grid: &'a Grid, y: i64) -> Self { + let iter = grid.data[y as usize * grid.width()..(y as usize + 1) * grid.width()].iter(); + Self { iter } + } +} + +impl<'a, T> Iterator for GridRowIter<'a, T> { + type Item = &'a T; + fn next(&mut self) -> Option { + self.iter.next() + } + fn size_hint(&self) -> (usize, Option) { + self.iter.size_hint() + } +} + +#[derive(Debug)] +pub struct CoordIter<'a, T> { + pos: usize, + grid: &'a Grid, +} + +impl<'a, T: Clone + Eq + PartialEq + Debug> Iterator for CoordIter<'a, T> { + type Item = Coord2d; + fn next(&mut self) -> Option { + if self.pos < self.grid.data.len() { + self.pos += 1; + self.grid.coord(self.pos as i64 - 1) + } else { + None + } + } +} + +#[derive(Debug)] +pub struct ItemIter<'a, T> { + pos: usize, + grid: &'a Grid, +} + +#[derive(Debug, PartialEq, Eq)] +pub struct Item<'a, T> { + pub pos: Coord2d, + pub value: &'a T, +} + +impl<'a, T: Clone + Eq + PartialEq + Debug> Iterator for ItemIter<'a, T> { + type Item = Item<'a, T>; + fn next(&mut self) -> Option { + if self.pos < self.grid.data.len() { + self.pos += 1; + Some(Item { + pos: self.grid.coord(self.pos as i64 - 1).unwrap(), + value: &self.grid.data[self.pos - 1], + }) + } else { + None + } + } +} + +#[derive(Debug)] +pub struct GridColIter<'a, T> { + grid: &'a Grid, + stride: usize, + cur: usize, +} + +impl<'a, T: Clone + Eq + PartialEq + Debug> GridColIter<'a, T> { + fn new(grid: &'a Grid, x: i64) -> Self { + Self { + grid, + stride: grid.width(), + cur: x as usize, + } + } +} + +impl<'a, T: Clone + Eq + PartialEq + Debug> Iterator for GridColIter<'a, T> { + type Item = &'a T; + fn next(&mut self) -> Option { + let cur = self.cur; + self.cur += self.stride; + if cur < self.grid.data.len() { + Some(&self.grid.data[cur]) + } else { + None + } + } + fn size_hint(&self) -> (usize, Option) { + (self.grid.height() - 1, Some(self.grid.height() - 1)) + } +} + +#[derive(Debug)] +pub struct OffsetsIter<'a, T> { + grid: &'a Grid, + origin: Coord2d, + cur: usize, + offsets: &'a [&'a (i64, i64)], +} + +impl<'a, T: Clone + Eq + PartialEq + Debug> Iterator for OffsetsIter<'a, T> { + type Item = Item<'a, T>; + fn next(&mut self) -> Option { + while self.cur < self.offsets.len() { + let pos = self.origin + self.offsets[self.cur]; + self.cur += 1; + if let Some(value) = self.grid.get(&pos) { + return Some(Item { pos, value }); + } + } + None + } + fn size_hint(&self) -> (usize, Option) { + (0, Some(self.offsets.len() - self.cur)) + } +} + +#[derive(Clone, Eq, PartialEq, Debug, Hash)] +pub struct Grid { + pub data: Vec, + width: i64, +} + +impl Grid { + /// Returns a new [Grid] with the same shape (width x height) as `self`, filled with `fill` + pub fn same_shape(&self, fill: NT) -> Grid { + Grid::with_shape(self.width(), self.height(), fill) + } + /// Returns a new [Grid] with the given shape (width x height), filled with `fill` + pub fn with_shape(width: usize, height: usize, fill: T) -> Self { + Self { + data: Vec::from_iter(repeat_n(fill, width * height)), + width: width as i64, + } + } + pub fn width(&self) -> usize { + self.width as usize + } + pub fn height(&self) -> usize { + self.data.len() / self.width() + } + pub fn pos(&self, c: &C) -> i64 { + c.y() * self.width + c.x() + } + pub fn coord(&self, pos: i64) -> Option { + if pos < 0 || pos >= self.data.len() as i64 { + None + } else { + Some(Coord2d { + x: pos % self.width, + y: pos / self.width, + }) + } + } + pub fn coord_iter<'a>(&'a self) -> CoordIter<'a, T> { + CoordIter { pos: 0, grid: self } + } + pub fn item_iter<'a>(&'a self) -> ItemIter<'a, T> { + ItemIter { pos: 0, grid: self } + } + pub fn is_valid(&self, c: &C) -> bool { + if c.x() < 0 || c.x() >= self.width { + return false; + } + if c.y() < 0 || c.y() as usize >= self.height() { + return false; + } + true + } + fn valid_pos(&self, c: &C) -> Option { + if c.x() < 0 || c.x() >= self.width { + return None; + } + if c.y() < 0 || c.y() as usize >= self.height() { + return None; + } + let pos = self.pos(c); + if pos < 0 || pos as usize >= self.data.len() { + return None; + } + self.pos(c).try_into().ok() + } + pub fn get(&self, c: &C) -> Option<&T> { + match self.valid_pos(c) { + Some(pos) => Some(&self.data[pos]), + None => None, + } + } + pub fn get_mut(&mut self, c: &C) -> Option<&mut T> { + match self.valid_pos(c) { + Some(pos) => Some(self.data.get_mut(pos).unwrap()), + None => None, + } + } + pub fn set(&mut self, c: &C, mut val: T) -> Option { + match self.valid_pos(c) { + Some(pos) => { + swap(&mut self.data[pos], &mut val); + Some(val) + } + None => None, + } + } + pub fn increment<'a, A, C: AsCoord2d>(&'a mut self, c: &C, i: A) -> Option<&'a T> + where + T: AddAssign, + { + match self.valid_pos(c) { + Some(pos) => { + self.data[pos] += i; + Some(&self.data[pos]) + } + None => None, + } + } + pub fn row(&self, y: i64) -> Option<&[T]> { + if y < self.height() as i64 && y >= 0 { + Some(&self.data[self.pos(&(0, y)) as usize..self.pos(&(self.width, y)) as usize]) + } else { + None + } + } + + pub fn row_iter<'a>(&'a self, y: i64) -> Option> { + if (y as usize) < self.height() { + Some(GridRowIter::new(self, y)) + } else { + None + } + } + + pub fn col(&self, x: i64) -> Option> { + self.col_iter(x).map(|iter| iter.collect()) + } + + pub fn col_iter<'a>(&'a self, x: i64) -> Option> { + if (x as usize) < self.width() { + Some(GridColIter::new(self, x)) + } else { + None + } + } + + pub fn find(&self, needle: &T) -> Option { + self.coord( + self.data + .iter() + .enumerate() + .find_map(|(pos, val)| { + if val == needle { + Some(pos as i64) + } else { + None + } + }) + .unwrap_or(-1), + ) + } + /// Get all of the coordinates having value `needle` + pub fn find_all<'a>(&'a self, needle: &'a T) -> impl DoubleEndedIterator + 'a { + self.data + .iter() + .enumerate() + .filter_map(|(pos, val)| (*val == *needle).then_some(self.coord(pos as i64).unwrap())) + } + pub fn count(&self, haystack: &T) -> usize { + self.data.iter().filter(|item| *item == haystack).count() + } + + pub fn forward_slice(&self, start: &C, len: i64) -> Option<&[T]> { + let pos = ( + self.valid_pos(start), + self.valid_pos(&(start.x() + len - 1, start.y())), + ); + match pos { + (Some(pos1), Some(pos2)) => Some(&self.data[pos1..pos2 + 1]), + _ => None, + } + } + + pub fn swap(&mut self, a: A, b: B) { + if let (Some(a), Some(b)) = (self.valid_pos(&a), self.valid_pos(&b)) { + self.data.swap(a, b) + } + } + + /// Return the count of neighbours (8 directions) matching predicate p + pub fn adjacent_count(&self, c: &C, mut p: P) -> usize + where + P: FnMut(&T) -> bool, + { + self.adjacent_iter(c).filter(|i| p(i.value)).count() + } + + /// Return the count of cardinal neighbours (4 directions) matching predicate p + pub fn cardinal_count(&self, c: &C, mut p: P) -> usize + where + P: FnMut(&T) -> bool, + { + self.cardinal_iter(c).filter(|i| p(i.value)).count() + } + + /// Return an iterator over the 8 neighbours of c. The iterator skips neighbouring positions outside of the grid. + pub fn adjacent_iter<'a, C: AsCoord2d + Copy>(&'a self, c: &'a C) -> OffsetsIter<'a, T> { + OffsetsIter { + grid: self, + origin: c.to_coord(), + cur: 0, + offsets: &ADJACENT_OFFSETS, + } + } + + /// Return an iterator over the 4 cardinal neighbours of c. The iterator skips neighbouring positions outside of the grid. + pub fn cardinal_iter<'a, C: AsCoord2d + Copy>(&'a self, c: &'a C) -> OffsetsIter<'a, T> { + OffsetsIter { + grid: self, + origin: c.to_coord(), + cur: 0, + offsets: &CARDINAL_OFFSETS, + } + } + + pub fn rotated(&self, mut rot: u8) -> Self { + rot %= 4; + match rot { + 0 => self.clone(), + 1 => { + let mut n = Grid::with_shape(self.height(), self.width(), self.data[0].clone()); // fill will be overwritten anyway + for y in 0..self.height() { + for x in 0..self.width() { + n.set( + &(self.height() - y - 1, x), + self.get(&(x as u64, y as u64)).unwrap().clone(), + ); + } + } + n + } + 2 => { + let mut n = Grid::with_shape(self.height(), self.width(), self.data[0].clone()); // fill will be overwritten anyway + for y in 0..self.height() { + for x in 0..self.width() { + n.set( + &(self.width() - x - 1, self.height() - y - 1), + self.get(&(x as u64, y as u64)).unwrap().clone(), + ); + } + } + n + } + 3 => { + let mut n = Grid::with_shape(self.height(), self.width(), self.data[0].clone()); // fill will be overwritten anyway + for y in 0..self.height() { + for x in 0..self.width() { + n.set( + &(self.height() - y - 1, self.width() - x - 1), + self.get(&(x as u64, y as u64)).unwrap().clone(), + ); + } + } + n + } + _ => unreachable!("invalid rotation"), + } + } + + pub fn mirrored(&self, axis: MirrorAxis) -> Self { + match axis { + MirrorAxis::X => { + let mut n = Grid::with_shape(self.height(), self.width(), self.data[0].clone()); // fill will be overwritten anyway + for y in 0..self.height() { + for x in 0..self.width() { + n.set( + &(self.width() - x - 1, y), + self.get(&(x as u64, y as u64)).unwrap().clone(), + ); + } + } + n + } + MirrorAxis::Y => { + let mut n = Grid::with_shape(self.height(), self.width(), self.data[0].clone()); // fill will be overwritten anyway + for y in 0..self.height() { + for x in 0..self.width() { + n.set( + &(x, &self.height() - y - 1), + self.get(&(x as u64, y as u64)).unwrap().clone(), + ); + } + } + n + } + } + } + + // fn window_compare_impl(&self, needle: &[T]) -> Vec<(i64, i64)> { + // if (self.width as usize) < needle.len() { + // return Vec::new(); + // } + // let mut res = Vec::new(); + // for y in 0..self.height() as i64 { + // let mut windows_tmp = self.row(y).unwrap().windows(needle.len()); + // let windows = if REV { + // windows_tmp.rev() + // } else { + // windows_tmp + // }; + + // res.extend( + // windows + // .enumerate() + // .filter_map(|(x, w)| if w == needle { Some((x as i64, y)) } else { None }), + // ); + // } + // res + // } +} + +impl From for Grid { + fn from(input: T) -> Grid { + let mut data = Vec::new(); + let mut width = 0; + for line in input.split(b'\n').map(|i| i.unwrap()) { + if width == 0 { + width = line.len() as i64 + } else if line.len() as i64 != width { + panic!("Grids must have fixed length rows") + } + data.extend_from_slice(&line); + } + Grid { data, width } + } +} + +// Should be Grid? +impl FromStr for Grid { + type Err = Box; + fn from_str(s: &str) -> Result { + Ok(Cursor::new(s).into()) + } +} + +// impl> Display for Grid { +// fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { +// for y in 0..self.height() { +// for x in 0..self.width() { +// f.write_fmt(format_args!("{}",self.get(x as i64, y as i64).unwrap() as char))?; +// } +// f.write_char('\n')?; +// } +// f.write_char('\n') +// } +// } + +impl Display for Grid { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + for y in 0..self.height() { + for x in 0..self.width() { + f.write_fmt(format_args!( + "{}", + *self.get(&(x as i64, y as i64)).unwrap() as char + ))?; + } + f.write_char('\n')?; + } + f.write_char('\n') + } +} + +impl Display for Grid { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + for y in 0..self.height() { + for x in 0..self.width() { + f.write_fmt(format_args!( + "{}", + match *self.get(&(x as i64, y as i64)).unwrap() { + true => '.', + false => '#', + } + ))?; + } + f.write_char('\n')?; + } + f.write_char('\n') + } +} + +#[cfg(test)] +mod tests { + use super::*; + + static TEST_VECTOR: &[u8] = b"ABCD +EFGH +IJKL +FBCG"; + + static TEST_VECTOR_S: &str = "ABCD +EFGH +IJKL +FBCG"; + + fn unchecked_load() -> Grid { + Grid::from(TEST_VECTOR) + } + + #[test] + fn from_string() { + let grid = unchecked_load(); + assert_eq!(grid.data, "ABCDEFGHIJKLFBCG".as_bytes()); + assert_eq!( + TEST_VECTOR_S.parse::>().unwrap().data, + "ABCDEFGHIJKLFBCG".as_bytes() + ); + } + + #[test] + fn indexing() { + let grid = unchecked_load(); + assert_eq!(grid.get(&(0, 0)), Some(b'A').as_ref()); + assert_eq!(grid.get(&(3, 3)), Some(b'G').as_ref()); + assert_eq!(grid.get(&(-1, 0)), None); + assert_eq!(grid.get(&(0, -1)), None); + assert_eq!(grid.get(&(5, 0)), None); + assert_eq!(grid.get(&(0, 5)), None); + } + + #[test] + fn forward_slice() { + let grid = unchecked_load(); + assert_eq!(grid.forward_slice(&(0, 0), 2), Some(b"AB".as_slice())); + assert_eq!(grid.forward_slice(&(2, 0), 2), Some(b"CD".as_slice())); + assert_eq!(grid.forward_slice(&(2, 0), 3), None); + assert_eq!(grid.forward_slice(&(0, 2), 4), Some(b"IJKL".as_slice())); + } + + #[test] + fn row_iter() { + let grid = unchecked_load(); + assert_eq!( + grid.row_iter(2).unwrap().collect::>(), + [&b'I', &b'J', &b'K', &b'L'] + ); + assert!(grid.row_iter(-1).is_none()); + assert!(grid.row_iter(4).is_none()); + } + + #[test] + fn col_iter() { + let grid = unchecked_load(); + assert_eq!( + grid.col_iter(2).unwrap().collect::>(), + [&b'C', &b'G', &b'K', &b'C'] + ); + assert!(grid.col_iter(-1).is_none()); + assert!(grid.col_iter(4).is_none()); + } + + #[test] + fn find_all() { + let grid = unchecked_load(); + assert_eq!( + grid.find_all(&b'G').collect::>(), + [Coord2d { x: 2, y: 1 }, Coord2d { x: 3, y: 3 }] + ) + } + + #[test] + fn neighbours_iter() { + let grid = unchecked_load(); + assert_eq!( + grid.adjacent_iter(&(0, 1)).collect::>(), + [ + Item { + pos: Coord2d { x: 0, y: 0 }, + value: &b'A' + }, + Item { + pos: Coord2d { x: 1, y: 0 }, + value: &b'B' + }, + Item { + pos: Coord2d { x: 1, y: 1 }, + value: &b'F' + }, + Item { + pos: Coord2d { x: 0, y: 2 }, + value: &b'I' + }, + Item { + pos: Coord2d { x: 1, y: 2 }, + value: &b'J' + }, + ] + ) + } + + #[test] + fn cardinal_iter() { + let grid = unchecked_load(); + assert_eq!( + grid.cardinal_iter(&(0, 1)).collect::>(), + [ + Item { + pos: Coord2d { x: 0, y: 0 }, + value: &b'A' + }, + Item { + pos: Coord2d { x: 1, y: 1 }, + value: &b'F' + }, + Item { + pos: Coord2d { x: 0, y: 2 }, + value: &b'I' + } + ] + ) + } + + // #[test] + // fn window_compare() { + // let grid = unchecked_load(); + // assert_eq!(grid.window_compare(b"IJKL"), &[(0, 2)]); + // assert_eq!(grid.window_compare(b"BC"), &[(1, 0), (1, 3)]); + // assert_eq!(grid.window_compare(b"LF").len(), 0); + // } +} diff --git a/2026/utils/misc/Cargo.lock b/2026/utils/misc/Cargo.lock new file mode 100644 index 0000000..6dfd16a --- /dev/null +++ b/2026/utils/misc/Cargo.lock @@ -0,0 +1,44 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "intrusive-collections" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" +dependencies = [ + "memoffset", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "misc" +version = "0.1.0" +dependencies = [ + "intrusive-collections", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] diff --git a/2026/utils/misc/Cargo.toml b/2026/utils/misc/Cargo.toml new file mode 100644 index 0000000..cf51035 --- /dev/null +++ b/2026/utils/misc/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "misc" +version = "0.1.0" +edition = "2024" + +[dependencies] +intrusive-collections = "0.9.7" +num-traits = "0.2.19" diff --git a/2026/utils/misc/src/lib.rs b/2026/utils/misc/src/lib.rs new file mode 100644 index 0000000..97836e2 --- /dev/null +++ b/2026/utils/misc/src/lib.rs @@ -0,0 +1,115 @@ +use num_traits::Signed; +use std::fmt::Display; +use std::ops::{Add, AddAssign}; + +pub mod range; + +const POW10MAX: usize = u64::MAX.ilog10() as usize; +pub const POW10: [u64; POW10MAX] = pow10_lut(); + +const fn pow10_lut() -> [u64; N] { + let mut res = [0; N]; + let mut i = 0; + while i < N { + res[i] = 10u64.pow(i as u32); + i += 1; + } + res +} + +/// Wrapped signed integer with custom upper bound with wrapping of 0s to the upper bound +#[derive(Eq, Clone, Copy)] +pub struct CustomWrapped { + pub val: T, + pub bound: T, +} + +impl Add for CustomWrapped { + type Output = CustomWrapped; + fn add(self, rhs: T) -> Self::Output { + Self { + val: ((self.val + rhs % self.bound) + self.bound) % self.bound, + bound: self.bound, + } + } +} + +impl Add for &CustomWrapped { + type Output = CustomWrapped; + fn add(self, rhs: T) -> Self::Output { + CustomWrapped { + val: ((self.val + rhs % self.bound) + self.bound) % self.bound, + bound: self.bound, + } + } +} + +impl AddAssign for CustomWrapped { + fn add_assign(&mut self, rhs: T) { + self.val = ((self.val + rhs % self.bound) + self.bound) % self.bound + } +} + +impl CustomWrapped { + pub fn new(val: T, bound: T) -> Self { + Self { val, bound } + } +} + +impl PartialEq for CustomWrapped { + fn eq(&self, other: &Self) -> bool { + self.val.eq(&other.val) + } +} + +impl PartialOrd for CustomWrapped { + fn partial_cmp(&self, other: &Self) -> Option { + self.val.partial_cmp(&other.val) + } +} + +impl Ord for CustomWrapped { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.val.cmp(&other.val) + } +} + +impl PartialEq for CustomWrapped { + fn eq(&self, other: &T) -> bool { + self.val == *other + } +} + +impl PartialOrd for CustomWrapped { + fn partial_cmp(&self, other: &T) -> Option { + self.val.partial_cmp(other) + } +} + +impl Display for CustomWrapped +where + T: Display, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.val.fmt(f) + } +} + +// impl Into for CustomWrapped { +// fn into(self) -> T { +// self.val +// } +// } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_pow10() { + #[allow(clippy::needless_range_loop)] + for i in 0..POW10MAX { + assert_eq!(POW10[i], 10u64.pow(i as u32)) + } + } +} diff --git a/2026/utils/misc/src/range.rs b/2026/utils/misc/src/range.rs new file mode 100644 index 0000000..b2d44f8 --- /dev/null +++ b/2026/utils/misc/src/range.rs @@ -0,0 +1,124 @@ +use intrusive_collections::Bound as IBound; +use intrusive_collections::{KeyAdapter, intrusive_adapter}; +use intrusive_collections::{RBTreeLink, rbtree::RBTree}; +use std::cmp::{max, min}; +use std::ops::{Add, Bound, RangeBounds, Sub}; + +#[derive(Debug)] +pub struct NaiveRange { + link: RBTreeLink, + pub start: T, + pub end: T, +} + +intrusive_adapter!( + pub NaiveRangeAdapter = Box>: NaiveRange { link: RBTreeLink } +); + +impl<'a, T: Ord + Clone> KeyAdapter<'a> for NaiveRangeAdapter { + type Key = T; + fn get_key(&self, node: &'a NaiveRange) -> T { + node.start.clone() + } +} + +impl NaiveRange { + fn new(start: T, end: T) -> Self { + Self { + link: RBTreeLink::new(), + start, + end, + } + } +} + +pub struct RangeSet { + pub store: RBTree>, +} + +fn normalize_range, T: Copy + Ord + Add + From>( + r: &R, +) -> NaiveRange { + let start = match r.start_bound() { + Bound::Included(x) => *x, + Bound::Excluded(x) => *x + T::from(1), + Bound::Unbounded => panic!(), + }; + let end = match r.end_bound() { + Bound::Included(x) => *x + T::from(1), + Bound::Excluded(x) => *x, + Bound::Unbounded => panic!(), + }; + + NaiveRange::new(start, end) +} + +impl + Sub + From> Default for RangeSet { + fn default() -> Self { + Self::new() + } +} + +impl + Sub + From> RangeSet { + pub fn new() -> Self { + Self { + store: RBTree::new(NaiveRangeAdapter::::new()), + } + } + pub fn add>(&mut self, r: &R) { + //normalize r to Range + let mut new_r = normalize_range(r); + + // Find the position of nearest entry >= and <= than new_r's start + let mut cur = self.store.lower_bound_mut(IBound::Included(&new_r.start)); + + while let Some(val) = cur.get() + && new_r.end >= val.start + { + // then remove them and update our new range + new_r.start = min(new_r.start, val.start); + new_r.end = max(new_r.end, val.end); + cur.remove(); // moves the cursor ahead + } + + // Move the cursor back one (this will be the element before our insertion point, 'below' start) + cur.move_prev(); + while let Some(val) = cur.get() + && new_r.start <= val.end + { + new_r.start = min(new_r.start, val.start); + new_r.end = max(new_r.end, val.end); + cur.remove(); + cur.move_prev(); + } + + // We are already in position, we just checked the previous element and it's before us + // since we fell out of the loop, so we need to go after this position + cur.insert_after(Box::new(new_r)); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_ranges() { + let mut set = RangeSet::new(); + // edge cases are tricky to construct, run the aoc2025 day 5 puzzle and compare :) + set.add(&(0..10)); + set.add(&(100..1000)); + set.add(&(50..100)); + set.add(&(50..100)); + set.add(&(1001..2000)); + set.add(&(2000..2001)); + set.add(&(-10..-2)); + set.add(&(-1..-1)); + let end = set + .store + .iter() + .map(|r| (r.start, r.end)) + .collect::>(); + assert_eq!(end, [(-10, 10), (50, 2001)]) + } +} diff --git a/README.md b/README.md index dc256f5..14bfa4b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,233 @@ - +

+ Advent of Code - 140/554 ⭐ +

+

+ 2026 - 4 ⭐ - Rust +

+
+ + + + + +

+ 2025 - 22 ⭐ - Rust +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ 2024 - 50 ⭐ - Rust +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ 2023 - 50 ⭐ - Rust +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ 2022 - 14 ⭐ - Rust +

+ + + + + + + + + + + + + + + + + + + + +