Closed patrickt closed 8 months ago
This is documented here:
In
UpperCamelCase
, acronyms and contractions of compound words count as one word: useUuid
rather thanUUID
,Usize
rather thanUSize
orStdin
rather thanStdIn
. Insnake_case
, acronyms and contractions are lower-cased:is_xid_start
.
Examples in the standard library include OsString
, TcpListener
, IpAddress
, Cow
, AsciiExt
, Utf8Error
. The ecosystem really does follow this rule: the uuid
crate really does use Uuid
; hyper has Http
instead of HTTP
; git2
has Oid
and Odb
; and so on.
According to @jorendorff, Rust best practices are to avoid capitalizing acronyms.