Rust variables: Difference between revisions

From wikinotes
(Created page with "= Assignment = <blockquote> <syntaxhighlight lang="rust"> let test_env: bool = true; </syntaxhighlight> </blockquote><!-- Assignment --> = Literals = <blockquote> <syntaxhigh...")
 
No edit summary
Line 13: Line 13:
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Literals -->
</blockquote><!-- Literals -->
= Introspection =
<blockquote>
<syntaxhighlight lang="rust">
use std::any::type_name;
</syntaxhighlight>
</blockquote><!-- Introspection -->

Revision as of 21:42, 29 August 2021

Assignment

let test_env: bool = true;

Literals

let float = 3.14; // f64
let integer = 7;  // i32

Introspection

use std::any::type_name;