Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 664 Bytes

File metadata and controls

23 lines (15 loc) · 664 Bytes

Unused Variables

A good practice is naming variables appropriately; however, variables may be unused at times such as the timestamp from the call().

{{#include ../../../code/language/style-guide/unused_variables/src/lib.sw:unused_variable}}

Named

We may preserve the name to provide context to the reader by prepending the variable with _.

{{#include ../../../code/language/style-guide/unused_variables/src/lib.sw:named_unused_variable}}

Nameless

We may discard the context and the value by assigning it to _.

{{#include ../../../code/language/style-guide/unused_variables/src/lib.sw:nameless_variable}}