From 6a801e93ceaf0b63f53be36c44e7976549767c39 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 18 Feb 2024 18:51:04 -0800 Subject: [PATCH 1/2] Prepare onlyargs_derive 0.1.4 Only the derive crate has updates. --- Cargo.lock | 2 +- onlyargs_derive/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff3b50e..caec350 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ dependencies = [ [[package]] name = "onlyargs_derive" -version = "0.1.3" +version = "0.1.4" dependencies = [ "myn", "onlyargs", diff --git a/onlyargs_derive/Cargo.toml b/onlyargs_derive/Cargo.toml index 7f24ad9..ee64bb8 100644 --- a/onlyargs_derive/Cargo.toml +++ b/onlyargs_derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "onlyargs_derive" description = "Obsessively tiny argument parsing derive macro" -version = "0.1.3" +version = "0.1.4" authors = ["Jay Oster "] repository = "https://github.com/parasyte/onlyargs" edition = "2021" From 23383d20063d64edf498b6f1731ae52d869ac65f Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 18 Feb 2024 18:58:51 -0800 Subject: [PATCH 2/2] Add missing positional args tests --- onlyargs_derive/compile_tests/compiler.rs | 2 ++ onlyargs_derive/compile_tests/conflicting_positional.rs | 7 +++++++ .../compile_tests/conflicting_positional.stderr | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 onlyargs_derive/compile_tests/conflicting_positional.rs create mode 100644 onlyargs_derive/compile_tests/conflicting_positional.stderr diff --git a/onlyargs_derive/compile_tests/compiler.rs b/onlyargs_derive/compile_tests/compiler.rs index e486e4d..740489c 100644 --- a/onlyargs_derive/compile_tests/compiler.rs +++ b/onlyargs_derive/compile_tests/compiler.rs @@ -28,7 +28,9 @@ fn compile_tests() { t.pass("compile_tests/positional_pathbuf.rs"); t.pass("compile_tests/positional_string.rs"); t.pass("compile_tests/positional_u8.rs"); + t.pass("compile_tests/positional_u128.rs"); t.pass("compile_tests/positional_usize.rs"); + t.compile_fail("compile_tests/conflicting_positional.rs"); t.pass("compile_tests/empty.rs"); t.pass("compile_tests/optional.rs"); diff --git a/onlyargs_derive/compile_tests/conflicting_positional.rs b/onlyargs_derive/compile_tests/conflicting_positional.rs new file mode 100644 index 0000000..3b9f2b2 --- /dev/null +++ b/onlyargs_derive/compile_tests/conflicting_positional.rs @@ -0,0 +1,7 @@ +#[derive(Debug, onlyargs_derive::OnlyArgs)] +struct Args { + rest: Vec, + more: Vec, +} + +fn main() {} diff --git a/onlyargs_derive/compile_tests/conflicting_positional.stderr b/onlyargs_derive/compile_tests/conflicting_positional.stderr new file mode 100644 index 0000000..f385a2c --- /dev/null +++ b/onlyargs_derive/compile_tests/conflicting_positional.stderr @@ -0,0 +1,5 @@ +error: Positional arguments can only be specified once. + --> compile_tests/conflicting_positional.rs:4:5 + | +4 | more: Vec, + | ^^^^