Skip to content

Commit fd63b06

Browse files
committed
[enhance] include unstable notification in doc_hint
1 parent 529ee23 commit fd63b06

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

config_proc_macro/src/item_enum.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ fn impl_from_str(ident: &syn::Ident, variants: &Variants) -> TokenStream {
149149
}
150150

151151
fn doc_hint_of_variant(variant: &syn::Variant) -> String {
152-
find_doc_hint(&variant.attrs).unwrap_or(variant.ident.to_string())
152+
let mut text = find_doc_hint(&variant.attrs).unwrap_or(variant.ident.to_string());
153+
if unstable_of_variant(&variant) {
154+
text.push_str(" (unstable)")
155+
};
156+
text
153157
}
154158

155159
fn config_value_of_variant(variant: &syn::Variant) -> String {

0 commit comments

Comments
 (0)