Hello, RantAI team. Thank you for your interesting works in writing a series of Rust books for everyone!
While I am reading, I found some typo and a few things that need to be revised.
- In the section 8.2.1. Fundamental Types, "Pointer types (
const T, mut T)" has to be corrected into "Pointer types (*const T, *mut T)".
- Similarly, In the fourth paragraph of section 8.4. Void,
const T has to be corrected into * const T.
- In the section 8.5. Sizes, four items in the leading-statement have incorrect code snippet since they omit type annotations with angled brackets after
size_of::.
- In the section 8.7. Declarations, the second code snippet example said that redefinition of local variables causes an error and redefinition of static variables is acceptable. However, it is not true. Local variables, whatever they are mutable or not, can be redefined and uninitialized when they are created. However, every static and const variable must be initialized with values and cannot be re-defined in the same scope.
- In the section 8.9. Keywords, the first line of the table (the summary table for keywords) are all bolded and capitalized. Is it intended?
- At the bottom of the table,
abstract\[\[cite has to be corrected into abstract.
- In many parts including the chapter 8, the underscores (_) are frequently written as (\_).
- In the section 8.10. Scopes, the first-to-fourth code snippet can mislead the understanding of the scope because they are not syntactically incorrect. only
const and static variables initialized with values can be declared at the global levels (or the crate levels). So, I think that you need to revise the snippet just by using curly braces but not with functions.
- In the section 8.11.2. Initializer Lists, “While the
= is optional” in the second paragraph is incorrect. I think that you are a little confused with the copy initialization or copy-list initialization in C++. Modern C++ recommends the list initialization with curly braces in most cases.
- In the same paragraph, you said that “To explicitly use default initialization, use
{}:”. This explanation looks rather ambiguous since only data types implemented with Default trait will support the default initialization with the empty {}. I know that you will explain this elsewhere but it need to be strictly described to avoid any misleading.
- In the section 8.12. Deducing a Type, you mentioned
typeof. As far as I know, the Rust core team has no plan to support typeof even though they reserve it as one of future keywords. And there is no function like typeof, if I am correct. Instead, Rust has std::any::type_name::<T>() that is similar to typeof in C++.
- The section 8.12.3. The typeof() specifier has also the same problem since Rust and its standard library do not support
typedof. I think it comes from typedef crate [Link]. Please check for this issue.
- In the paragraph under the fifth code snippet example of the section 8.14. Type Aliases, “be found in the header in C++” should be corrected into “be found in the
<cstdint> header in C++”.
In addition, there is a little ambiguity in explaining the variable initialization because the curly braces are not essential when the scalar type variables are declared. I think it would come from the side-by-side comparison with C++. Anyway, your works really helps non-Rustaceans like me understand the key concept behind Rust. I hope your material is more developed and getting widely known to others.
Regards.
Hello, RantAI team. Thank you for your interesting works in writing a series of Rust books for everyone!
While I am reading, I found some typo and a few things that need to be revised.
const T,mut T)" has to be corrected into "Pointer types (*const T,*mut T)".const Thas to be corrected into* const T.size_of::.abstract\[\[citehas to be corrected intoabstract.constandstaticvariables initialized with values can be declared at the global levels (or the crate levels). So, I think that you need to revise the snippet just by using curly braces but not with functions.=is optional” in the second paragraph is incorrect. I think that you are a little confused with the copy initialization or copy-list initialization in C++. Modern C++ recommends the list initialization with curly braces in most cases.{}:”. This explanation looks rather ambiguous since only data types implemented withDefaulttrait will support the default initialization with the empty{}. I know that you will explain this elsewhere but it need to be strictly described to avoid any misleading.typeof. As far as I know, the Rust core team has no plan to supporttypeofeven though they reserve it as one of future keywords. And there is no function liketypeof, if I am correct. Instead, Rust hasstd::any::type_name::<T>()that is similar totypeofin C++.typedof. I think it comes fromtypedefcrate [Link]. Please check for this issue.<cstdint>header in C++”.In addition, there is a little ambiguity in explaining the variable initialization because the curly braces are not essential when the scalar type variables are declared. I think it would come from the side-by-side comparison with C++. Anyway, your works really helps non-Rustaceans like me understand the key concept behind Rust. I hope your material is more developed and getting widely known to others.
Regards.