Gtk-rs style guild

I have been following the convention of using snake_case for my functions, but when I write enums the compiler says “variant ‘gluten_free_diet’ should have an upper camel case name”. I couldn’t find enums with more then one word in other GNOME rust apps.
What is the recommended way of writing enumerations?

p.s. I am working on GNOME Recipes.

1 Like

You would ideally follow the Rust naming style, otherwise you’ll get compiler warnings unless you disable them. For enum variants that would be CamelCase, see e.g. gio::IOErrorEnum::NotFound.

Thanks, I’ll follow the rust style. I wasn’t too sure if I should have been following a GNOME style.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.