diff --git a/nostarch/chapter03.md b/nostarch/chapter03.md index 1d7407cb0..12f749a0b 100644 --- a/nostarch/chapter03.md +++ b/nostarch/chapter03.md @@ -137,15 +137,15 @@ Not being able to change the value of a variable might have reminded you of another programming concept that most languages have: *constants*. Constants are also values bound to a name that are not allowed to change, but there are a few differences between constants and variables. First, using `mut` with -constants is not allowed: constants aren't just immutable by default, they're +constants is not allowed: constants aren't only immutable by default, they're always immutable. Constants are declared using the `const` keyword instead of the `let` keyword, and the type of the value *must* be annotated. We're about to cover types and type annotations in the next section, “Data Types,” so don't -worry about the type annotation right now. Constants can be declared in any -scope, including the global scope, which makes them useful for a value that -many parts of your code need to know about. The last difference is that -constants may only be set to a constant expression, not the result of a -function call or any other value that could only be used at runtime. +worry about the details right now. Constants can be declared in any scope, +including the global scope, which makes them useful for a value that many parts +of your code need to know about. The last difference is that constants may only +be set to a constant expression, not the result of a function call or any other +value that could only be used at runtime. Here's an example of a constant declaration where the constant's name is `MAX_POINTS` and its value is set to 100,000. Rust constant naming convention diff --git a/nostarch/odt/chapter03.odt b/nostarch/odt/chapter03.odt index 03409db1c..ca817bc5a 100644 Binary files a/nostarch/odt/chapter03.odt and b/nostarch/odt/chapter03.odt differ diff --git a/src/ch03-01-variables-and-mutability.md b/src/ch03-01-variables-and-mutability.md index 16c61f002..341afc27b 100644 --- a/src/ch03-01-variables-and-mutability.md +++ b/src/ch03-01-variables-and-mutability.md @@ -108,15 +108,15 @@ Not being able to change the value of a variable might have reminded you of another programming concept that most languages have: *constants*. Constants are also values bound to a name that are not allowed to change, but there are a few differences between constants and variables. First, using `mut` with -constants is not allowed: constants aren't just immutable by default, they're +constants is not allowed: constants aren't only immutable by default, they're always immutable. Constants are declared using the `const` keyword instead of the `let` keyword, and the type of the value *must* be annotated. We're about to cover types and type annotations in the next section, “Data Types,” so don't -worry about the type annotation right now. Constants can be declared in any -scope, including the global scope, which makes them useful for a value that -many parts of your code need to know about. The last difference is that -constants may only be set to a constant expression, not the result of a -function call or any other value that could only be used at runtime. +worry about the details right now. Constants can be declared in any scope, +including the global scope, which makes them useful for a value that many parts +of your code need to know about. The last difference is that constants may only +be set to a constant expression, not the result of a function call or any other +value that could only be used at runtime. Here's an example of a constant declaration where the constant's name is `MAX_POINTS` and its value is set to 100,000. Rust constant naming convention