FuelLabs/sway

Document the `const` keyword in the Sway Book

Offen

#1.892 geöffnet am 07.06.2022

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Rust (5.421 Forks)batch import
The Sway Bookgood first issue

Repository-Metriken

Stars
 (61.702 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 22h 6m) (16 gemergte PRs in 30 T)

Beschreibung

const is used in multiple places in the Sway Book but it should have its own section that explains how and where it can be used (e.g. local or global scope) and its limitations (e.g. no const structs yet).

Also, we are now able to use const in more places like constant structs for examples. We should point that out and indicate when const is usable today.

Finally, document when pub is needed. (ref: https://github.com/FuelLabs/sway/pull/2230)

Contributor Guide