Skip to content

Commit

Permalink
Change CamelCase to UpperCamelCase
Browse files Browse the repository at this point in the history
Brings the terminology in line with the rest of the project, see
<rust-lang/rfcs#2389>.

Connects to #2194.
  • Loading branch information
carols10cents committed Jan 23, 2023
1 parent 4404cbc commit f2a78f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions ci/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ unsafety
unsized
unsynchronized
Unyank
UpperCamelCase
URIs
UsefulType
username
Expand Down
8 changes: 4 additions & 4 deletions src/ch10-01-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ the duplication by introducing a generic type parameter in a single function.
To parameterize the types in a new single function, we need to name the type
parameter, just as we do for the value parameters to a function. You can use
any identifier as a type parameter name. But we’ll use `T` because, by
convention, type parameter names in Rust are short, often just a letter, and Rust’s
type-naming convention is CamelCase. Short for “type,” `T` is the default
choice of most Rust programmers.
convention, type parameter names in Rust are short, often just a letter, and
Rust’s type-naming convention is UpperCamelCase. Short for “type,” `T` is the
default choice of most Rust programmers.

When we use a parameter in the body of the function, we have to declare the
parameter name in the signature so the compiler knows what that name means.
Expand Down Expand Up @@ -274,7 +274,7 @@ method.
### Performance of Code Using Generics

You might be wondering whether there is a runtime cost when using generic type
parameters. The good news is that using generic types won't make your program run
parameters. The good news is that using generic types won't make your program run
any slower than it would with concrete types.

Rust accomplishes this by performing monomorphization of the code using
Expand Down

0 comments on commit f2a78f6

Please sign in to comment.