Skip to content

Commit

Permalink
Fix cargo aoc syntax
Browse files Browse the repository at this point in the history
Bump criterion
Bump various libs
Add a graceful error message when metadata are missing
  • Loading branch information
gobanos committed Nov 30, 2023
1 parent 1cce654 commit 705ce04
Show file tree
Hide file tree
Showing 21 changed files with 221 additions and 145 deletions.
118 changes: 62 additions & 56 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ members = [
"aoc-runner",
"aoc-runner-derive",
"aoc-runner-internal",
"cargo-aoc",
"examples"
"cargo-aoc"
]
exclude = [
"examples",
]
resolver = "2"
2 changes: 1 addition & 1 deletion aoc-runner-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/gobanos/aoc-runner-derive"
proc-macro = true

[dependencies]
syn = { version = "1.0.109", features = ["extra-traits"] }
syn = { version = "2.0.39", features = ["extra-traits"] }
quote = "1.0.33"
proc-macro2 = "1.0.69"
#aoc-runner-internal = { path = "../aoc-runner-internal" }
Expand Down
12 changes: 4 additions & 8 deletions aoc-runner-derive/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,14 @@ pub(crate) fn extract_result(ty: &syn::Type) -> Option<(SpecialType, syn::Type)>
if let Some(p) = s.last() {
if p.ident == "Result" {
if let PathArguments::AngleBracketed(a) = &p.arguments {
if let Some(arg) = a.args.first() {
if let GenericArgument::Type(t) = arg {
return Some((SpecialType::Result, t.clone()));
}
if let Some(GenericArgument::Type(t)) = a.args.first() {
return Some((SpecialType::Result, t.clone()));
}
}
} else if p.ident == "Option" {
if let PathArguments::AngleBracketed(a) = &p.arguments {
if let Some(arg) = a.args.first() {
if let GenericArgument::Type(t) = arg {
return Some((SpecialType::Option, t.clone()));
}
if let Some(GenericArgument::Type(t)) = a.args.first() {
return Some((SpecialType::Option, t.clone()));
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions cargo-aoc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-aoc"
version = "0.3.4"
version = "0.3.5"
authors = ["Grégory Obanos <gregory.obanos@gmail.com>", "Olivier Pinon <oliv.pinon@gmail.com>"]
description = "Cargo Advent of Code Helper"
license = "MIT/Apache-2.0"
Expand All @@ -13,13 +13,11 @@ edition = "2021"
[dependencies]
#aoc-runner-internal = { path = "../aoc-runner-internal" }
aoc-runner-internal = "0.1.0"
toml = "0.5.11"
toml = "0.8.8"
chrono = "0.4.31"
chrono-tz = "0.8.4"
reqwest = { version = "0.11.22", features = ["blocking"] }
webbrowser = "0.8.12"
directories = "4.0.1"
directories = "5.0.1"
clap = { version = "4.4.8", features = ["derive"] }
tokio = { version = "1.34.0", features = ["rt"] }


Loading

0 comments on commit 705ce04

Please # to comment.