From b8bcabd979099540f881c0db4bb70c1193e8419e Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Wed, 22 Oct 2025 02:34:51 +0200 Subject: [PATCH] fix: Wrap inner type in brackets --- src/lib.rs | 4 ++-- tests/notification.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e4a591d..ac45326 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -160,13 +160,13 @@ impl !Typed for () {} impl Typed for Option { fn type_name() -> String { - format!("{}?", ::type_name()) + format!("({})?", ::type_name()) } } impl Typed for Vec { fn type_name() -> String { - format!("{}[]", ::type_name()) + format!("({})[]", ::type_name()) } } diff --git a/tests/notification.rs b/tests/notification.rs index c0f1753..12509ce 100644 --- a/tests/notification.rs +++ b/tests/notification.rs @@ -60,7 +60,7 @@ fn action() { ---| "broadcast" ---@field extras table? ---@field label string - ---@field clear boolean? + ---@field clear (boolean)? local Action "#); } @@ -81,10 +81,10 @@ fn notification() { insta::assert_snapshot!(::generate_full().unwrap(), @r" ---@class Notification ---@field title string - ---@field message string? - ---@field tags string[]? - ---@field priority Priority? - ---@field actions Action[]? + ---@field message (string)? + ---@field tags (string)[]? + ---@field priority (Priority)? + ---@field actions (Action)[]? local Notification "); }