From f99c7ff92ccab61628fe9ba1453b9fcf925e3c3a Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 18 Feb 2024 21:00:54 -0600 Subject: [PATCH] Prepare onlyargs_derive 0.1.4 (#35) Only the derive crate has updates. * Add missing positional args tests --- Cargo.lock | 2 +- onlyargs_derive/Cargo.toml | 2 +- onlyargs_derive/compile_tests/compiler.rs | 2 ++ onlyargs_derive/compile_tests/conflicting_positional.rs | 7 +++++++ .../compile_tests/conflicting_positional.stderr | 5 +++++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 onlyargs_derive/compile_tests/conflicting_positional.rs create mode 100644 onlyargs_derive/compile_tests/conflicting_positional.stderr 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" 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, + | ^^^^