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 "); }