Rust's official naming guidelines suggest that we should use concise UpperCamelCase, usually single uppercase letter: T. But I have a trait with several associated types. Is it okay to use acronyms such as CD to represent, say, connection data? And I cannot use C, because it already exists (and also does not really portray "connection data"). I'd rather not use ConnectionData as that reads like a struct name. Should I not do this? I guess this question also applies to type parameters.
Associated type (type parameter) naming convention
52 Views Asked by bkc4 At
1
Where did you see that you should use shortcuts for associated types? They're commonly used for generic parameters (and even then, only when there is one or two), but not for associated types. Look in the standard library: there is no one-letter associated type.
ConnectionDatais the correct name.