<p>Rust는 숫자 변수 타입에 대해 알고 있어야하며, <code>u8</code>를 <code>u32</code>로 쉽게 사용할 수 없습니다.</p>
<p>Rust는 숫자 변수 타입에 대해 알고 있어야하며, <code>u8</code>를 <code>u32</code>로 쉽게 사용할 수 없습니다.</p>
<p>다행히 Rust는 <strong>as</strong> 키워드를 사용하여 숫자형을 쉽게 변환할 수 있습니다.</p>
<p>다행히 Rust는 <strong>as</strong> 키워드를 사용하여 숫자형을 쉽게 변환할 수 있습니다.</p>
<p>또는 <code>parse</code>를 자주 사용합니다.</p>
<pre><codeclass="rust">let my_string = "42"; let my_integer = my_string.parse::<i32>().unwrap(); // double colon op, ::<i32> syntax tells the compiler to parse the string as an i32 type</code></pre>