You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#218 added a boolean paramter to indicate whether fields are closed or open. In the interest of readability, we should change this to an enum before releasing v1.0.0 of ion-schema-rust.
Note that this is specifically calling out function parameters/arguments. It's fine to have a boolean as the return type of is_closed() because the function name describes the return value. However, something like fields(my_fields_map, true) has nothing to indicate the meaning of the boolean, whereas fields(my_fields_map, FieldContent::Closed) is very clear.
#218 added a boolean paramter to indicate whether fields are closed or open. In the interest of readability, we should change this to an enum before releasing
v1.0.0
ofion-schema-rust
.Note that this is specifically calling out function parameters/arguments. It's fine to have a boolean as the return type of
is_closed()
because the function name describes the return value. However, something likefields(my_fields_map, true)
has nothing to indicate the meaning of the boolean, whereasfields(my_fields_map, FieldContent::Closed)
is very clear.See e.g. https://blakesmith.me/2019/05/07/rust-patterns-enums-instead-of-booleans.html
The text was updated successfully, but these errors were encountered: