Skip to content

Commit 53f3f38

Browse files
authored
Explain nullable attribute.
1 parent 3428b99 commit 53f3f38

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

glib-macros/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,8 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream {
872872
/// `PropertySet` and `PropertySetNested` if possible.
873873
///
874874
/// The type `Option<T>` is supported as a property only if `Option<T>` implements `ToValueOptional`.
875-
/// Optional types also require the `nullable` attribute.
875+
/// Optional types also require the `nullable` attribute: without it, the generated setter on the wrapper type
876+
/// will take `T` instead of `Option<T>`, preventing the user from ever calling the setter with a `None` value.
876877
/// If your type doesn't support `PropertySet`, you can't use the generated setter, but you can
877878
/// always define a custom one.
878879
///

0 commit comments

Comments
 (0)