From f2a78f64b668f63f581203c6bac509903f7c00ee Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Mon, 23 Jan 2023 13:19:32 -0500 Subject: [PATCH] Change CamelCase to UpperCamelCase Brings the terminology in line with the rest of the project, see . Connects to #2194. --- ci/dictionary.txt | 1 + src/ch10-01-syntax.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ci/dictionary.txt b/ci/dictionary.txt index 9eb695d5..a91df4a0 100644 --- a/ci/dictionary.txt +++ b/ci/dictionary.txt @@ -546,6 +546,7 @@ unsafety unsized unsynchronized Unyank +UpperCamelCase URIs UsefulType username diff --git a/src/ch10-01-syntax.md b/src/ch10-01-syntax.md index c22aef7c..431dba96 100644 --- a/src/ch10-01-syntax.md +++ b/src/ch10-01-syntax.md @@ -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. @@ -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