docs: Tweaks to section on constants
This commit is contained in:
parent
4155a60c75
commit
f5dfd9b3ce
1 changed files with 1 additions and 8 deletions
|
@ -487,17 +487,10 @@ const MY_VECTORY_PASSWORD: [int * 5] = [1, 2, 3, 4, 5];
|
||||||
const MY_STRINGY_PASSWORD: &static/str = "12345";
|
const MY_STRINGY_PASSWORD: &static/str = "12345";
|
||||||
|
|
||||||
// Structs
|
// Structs
|
||||||
struct Password {
|
struct Password { value: int }
|
||||||
value: int
|
|
||||||
}
|
|
||||||
|
|
||||||
const MY_STRUCTY_PASSWORD: Password = Password { value: MY_PASSWORD };
|
const MY_STRUCTY_PASSWORD: Password = Password { value: MY_PASSWORD };
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
> ***Note:*** Support for compile-time constants and constant
|
|
||||||
> evaluation is essentially added 'as needed'. You may find that
|
|
||||||
> things you expect to work do not.
|
|
||||||
|
|
||||||
## Operators
|
## Operators
|
||||||
|
|
||||||
Rust's set of operators contains very few surprises. Arithmetic is done with
|
Rust's set of operators contains very few surprises. Arithmetic is done with
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue