switched to workspaces.
This should let me make a cross-day library.
This commit is contained in:
parent
1469c3a32b
commit
242989bb95
105
Cargo.lock
generated
105
Cargo.lock
generated
|
@ -3,51 +3,70 @@
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "advent_of_code_2022"
|
name = "aho-corasick"
|
||||||
|
version = "1.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day01"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day02"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day03"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day04"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"regex",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day05"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"regex",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day06"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "day07"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"regex",
|
"regex",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "day08"
|
||||||
version = "0.7.20"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
|
|
||||||
dependencies = [
|
|
||||||
"memchr",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.5.0"
|
version = "2.6.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "minimal-lexical"
|
|
||||||
version = "0.2.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nom"
|
|
||||||
version = "7.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
|
||||||
dependencies = [
|
|
||||||
"memchr",
|
|
||||||
"minimal-lexical",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.16.0"
|
version = "1.18.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
|
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
|
@ -69,9 +88,21 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.7.0"
|
version = "1.10.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
|
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-automata"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
@ -80,21 +111,25 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.28"
|
version = "0.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
|
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.38"
|
version = "2.0.39"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
|
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "template"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.50"
|
version = "1.0.50"
|
||||||
|
|
54
Cargo.toml
54
Cargo.toml
|
@ -1,49 +1,19 @@
|
||||||
[package]
|
[workspace]
|
||||||
name = "advent_of_code_2022"
|
members = [
|
||||||
|
"template",
|
||||||
|
"days/*",
|
||||||
|
]
|
||||||
|
default-members = [ "days/*" ]
|
||||||
|
resolver = "2"
|
||||||
|
|
||||||
|
[workspace.package]
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Gabriel Venberg"]
|
authors = ["Gabriel Venberg"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
description = "advent of code 2022 in rust"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
[workspace.dependencies]
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="template"
|
|
||||||
path="src/template/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day01"
|
|
||||||
path="src/day01/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day02"
|
|
||||||
path="src/day02/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day03"
|
|
||||||
path="src/day03/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day04"
|
|
||||||
path="src/day04/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day05"
|
|
||||||
path="src/day05/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day06"
|
|
||||||
path="src/day06/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day07"
|
|
||||||
path="src/day07/solve.rs"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name="day08"
|
|
||||||
path="src/day08/solve.rs"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
regex = "1"
|
regex = "1"
|
||||||
once_cell = "1.16"
|
once_cell = "1.16"
|
||||||
nom = "7.1"
|
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
|
nom = "7.1"
|
||||||
|
|
6
days/day01/Cargo.toml
Normal file
6
days/day01/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "day01"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
6
days/day02/Cargo.toml
Normal file
6
days/day02/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "day02"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
6
days/day03/Cargo.toml
Normal file
6
days/day03/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "day03"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
10
days/day04/Cargo.toml
Normal file
10
days/day04/Cargo.toml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[package]
|
||||||
|
name = "day04"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
once_cell.workspace = true
|
||||||
|
regex.workspace = true
|
10
days/day05/Cargo.toml
Normal file
10
days/day05/Cargo.toml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[package]
|
||||||
|
name = "day05"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
once_cell.workspace = true
|
||||||
|
regex.workspace = true
|
6
days/day06/Cargo.toml
Normal file
6
days/day06/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "day06"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
|
@ -1,7 +1,3 @@
|
||||||
/* pub fn parse(input: &str) -> usize {
|
|
||||||
unimplemented!()
|
|
||||||
} */
|
|
||||||
|
|
||||||
pub fn find_dupes_stupid<T: PartialEq>(slice: &[T]) -> bool {
|
pub fn find_dupes_stupid<T: PartialEq>(slice: &[T]) -> bool {
|
||||||
for i in 1..slice.len() {
|
for i in 1..slice.len() {
|
||||||
if slice[i..].contains(&slice[i - 1]) {
|
if slice[i..].contains(&slice[i - 1]) {
|
11
days/day07/Cargo.toml
Normal file
11
days/day07/Cargo.toml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[package]
|
||||||
|
name = "day07"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
once_cell.workspace = true
|
||||||
|
regex.workspace = true
|
||||||
|
thiserror.workspace = true
|
6
days/day08/Cargo.toml
Normal file
6
days/day08/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "day08"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
|
@ -1,4 +1,3 @@
|
||||||
#![allow(dead_code)]
|
|
||||||
mod part1;
|
mod part1;
|
||||||
mod part2;
|
mod part2;
|
||||||
mod utilities;
|
mod utilities;
|
|
@ -1,5 +1,4 @@
|
||||||
#![allow(unused)]
|
use crate::StructuredInput;
|
||||||
use crate::{utilities::*, StructuredInput};
|
|
||||||
|
|
||||||
pub fn part1(input: &StructuredInput) -> usize {
|
pub fn part1(input: &StructuredInput) -> usize {
|
||||||
let mut acc: usize = 0;
|
let mut acc: usize = 0;
|
|
@ -1,5 +1,4 @@
|
||||||
#![allow(unused)]
|
use crate::StructuredInput;
|
||||||
use crate::{utilities::*, StructuredInput};
|
|
||||||
|
|
||||||
pub fn part2(input: &StructuredInput) -> usize {
|
pub fn part2(input: &StructuredInput) -> usize {
|
||||||
let mut max: usize = 0;
|
let mut max: usize = 0;
|
|
@ -1,4 +1,3 @@
|
||||||
#![allow(unused)]
|
|
||||||
pub fn parse(input: &str) -> Vec<Vec<u8>> {
|
pub fn parse(input: &str) -> Vec<Vec<u8>> {
|
||||||
input
|
input
|
||||||
.lines()
|
.lines()
|
5
template/Cargo.toml
Normal file
5
template/Cargo.toml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[package]
|
||||||
|
name = "template"
|
||||||
|
authors.workspace = true
|
||||||
|
description.workspace = true
|
||||||
|
version.workspace = true
|
|
@ -1,3 +1,4 @@
|
||||||
|
//TODO:
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
mod part1;
|
mod part1;
|
||||||
mod part2;
|
mod part2;
|
|
@ -1,3 +1,4 @@
|
||||||
|
//TODO:
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
use crate::utilities::*;
|
use crate::utilities::*;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//TODO:
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
use crate::utilities::*;
|
use crate::utilities::*;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//TODO:
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
pub fn parse(input: &str) -> usize {
|
pub fn parse(input: &str) -> usize {
|
||||||
unimplemented!()
|
unimplemented!()
|
Loading…
Reference in a new issue