Naming question: I would like to start migrating o...
# development
f
Naming question: I would like to start migrating our Rust code to the Rust 2024 Edition. Due to
gen
being a keyword in the Rust 2024 edition, however, we should rename the
protos::gen
module so that we don't need to use raw identifier syntax for every use of
gen
. Any ideas on what should replace
gen
? That module is the root of the generated protobuf code in Rust.
Claude's recommendations: For a module containing generated protobuf code, here are some good alternatives to `gen`: Top recommendations:
proto
- Clean, short, and clearly indicates protobuf-related code •
pb
- Common abbreviation for "protobuf" used widely in the ecosystem •
generated
- Explicit about the nature of the code •
codegen
- Indicates code generation, commonly used pattern Other solid options:
protobufs
- More explicit plural form •
schemas
- Emphasizes the schema/message definitions •
messages
- Focuses on the protobuf messages •
rpc
- If these are primarily for RPC services •
api
- If they represent API definitions Considerations:
proto
is probably the most natural choice - it's short, clear, and widely recognized •
pb
is very common in protobuf toolchains (you'll see it in many codebases) •
generated
is the most explicit but slightly longer •
codegen
works well if you have other types of generated code too
My vote:
protos::pb
seems decent
w
proto and pb are what I tend to use in my code
👍 1
f
Given the crate is
protos
, I'm thinking
protos::proto
looks odd;
protos::pb
seems more compact to me.