1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-03 01:56:12 +02:00

clarify static details

Co-authored-by: Martin Geisler <mgeisler@google.com>
This commit is contained in:
Brandon Pollack 2023-01-10 05:05:45 -08:00 committed by GitHub
parent a532c23c60
commit b5a7c9cdcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,7 +54,7 @@ Sometimes you want a global constant that isn't constructable at compile time, s
<details>
* Mention that `const` behaves semantically similar to C++'s `constexpr`.
* `static`, on the other hand, is much more similar to a `const` or mutable global variable.
* `static`, on the other hand, is much more similar to a `const` or mutable global variable in C++.
* It isn't super common that one would need a runtime evaluated constant, but it is helpful and safer than using a static.
</details>