{"id":20091564,"url":"https://github.com/petertseng/adventofcode-rs-2019","last_synced_at":"2026-06-05T02:31:47.339Z","repository":{"id":72892957,"uuid":"230883064","full_name":"petertseng/adventofcode-rs-2019","owner":"petertseng","description":"Solutions to https://adventofcode.com/2019 (complete)","archived":false,"fork":false,"pushed_at":"2021-12-27T12:40:55.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T03:10:03.478Z","etag":null,"topics":["advent-of-code","advent-of-code-2019","rust"],"latest_commit_sha":null,"homepage":"https://adventofcode.com/2019","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petertseng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-30T09:01:14.000Z","updated_at":"2023-11-28T01:35:23.000Z","dependencies_parsed_at":"2024-07-22T04:33:41.789Z","dependency_job_id":null,"html_url":"https://github.com/petertseng/adventofcode-rs-2019","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertseng%2Fadventofcode-rs-2019","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertseng%2Fadventofcode-rs-2019/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertseng%2Fadventofcode-rs-2019/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertseng%2Fadventofcode-rs-2019/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petertseng","download_url":"https://codeload.github.com/petertseng/adventofcode-rs-2019/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241533642,"owners_count":19977825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent-of-code","advent-of-code-2019","rust"],"created_at":"2024-11-13T16:33:14.021Z","updated_at":"2026-06-05T02:31:47.296Z","avatar_url":"https://github.com/petertseng.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code\n\nThese are my solutions to http://adventofcode.com\n\nAll solutions are written in Rust.\n\n[![Build Status](https://travis-ci.org/petertseng/adventofcode-rs-2019.svg?branch=master)](https://travis-ci.org/petertseng/adventofcode-rs-2019)\n\n## Input\n\nIn general, all solutions can be invoked in both of the following ways:\n\n* Without command-line arguments, takes input on standard input.\n* With 1+ command-line arguments, reads input from the first, which must be the path to an input file.\n  Arguments beyond the first are ignored.\n\nSome may additionally support other ways:\n\n* All intcode days: May pass the intcode in ARGV as a single argument separated by commas.\n* Day 04 (Password): May pass min and max in ARGV (as two args, or as one arg joined by a hyphen).\n\n## Closing Thoughts\n\nSometimes `cargo fmt` does something I don't like, such as:\n\n```rust\nlet foo = bar\n    .iter()\n    .map(|v| {\n        // ...\n        // ...\n    })\n    .collect();\n```\n\nSo I restructure my code to avoid that, using one of two ways:\n\nFirst possibility is to move the closure to its own line,\nwhich works if the `collect` line ends up being short enough.\n\n```rust\nlet f = |v: T| {\n    // ...\n    // ...\n};\nlet foo = bar.iter().map(f).collect();\n```\n\nSecond possibility is to make the `map` the last thing by delaying the `collect`.\n\n```rust\nlet foo = bar.iter().map(|v| {\n    // ...\n    // ...\n});\nlet foo = foo.collect();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetertseng%2Fadventofcode-rs-2019","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetertseng%2Fadventofcode-rs-2019","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetertseng%2Fadventofcode-rs-2019/lists"}