Skip to content
Snippets Groups Projects
Select Git revision
  • 716be5337d2970fd954c0f1c340bbb61febeac0f
  • master default
2 results

12_ko.html

Blame
  • user avatar
    Alfex4936 authored
    716be533
    History
    12_ko.html 4.00 KiB
    <!DOCTYPE html>
        <html lang="ko">
        <head>
            <title>Rust 튜토리얼 - 자기주도프로젝트</title>
    
            <meta charset="UTF-8">
            <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
            <meta content="utf-8" http-equiv="encoding">
            <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
            <meta name="keywords" content="Rust, Programming, Learning">
            <meta name="description" content="Rust tutorial website based on tour_of_rust by 최석원">
            <meta name="theme-color" content="#ff6801"/>
            <meta http-equiv="Cache-Control" content="max-age=3600">
            
            <link rel="stylesheet" href="tour.css">
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/night-owl.min.css">
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css">
            
            <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
            <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
            <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
            <link rel="/manifest" href="./site.webmanifest">
            
            <script src="//unpkg.com/@highlightjs/cdn-assets@11.7.0/highlight.min.js"></script>
    
            <script src="./tour.js" defer></script>
            <!-- <script>hljs.highlightAll();</script> -->
            <script src="./highlight.badge.min.js"></script>
        </head>
        <body>
            <div class="tour">
                <div class="header">
                    <span class="title"><a href="index.html">Rust 튜토리얼</a></span>
                    <span class="nav">
                    <span class="toc"><a href="TOC_ko.html">목차</a></span>
                </div>
                <div class="page">
                <h1>Basic Type Conversion</h1>
                <p>Rust는 숫자 변수 타입에 대해 알고 있어야하며, <code>u8</code>를 <code>u32</code>로 쉽게 사용할 수 없습니다.</p>
    <p>다행히 Rust는 <strong>as</strong> 키워드를 사용하여 숫자형을 쉽게 변환할 수 있습니다.</p>
    <p>또는 <code>parse</code>를 자주 사용합니다.</p>
    <pre><code class="rust">let my_string = "42";
    let my_integer = my_string.parse::&lt;i32>().unwrap();
    // double colon op, ::&lt;i32> syntax tells the compiler to parse the string as an i32 type</code></pre>
                <div class="bottomnav">
                    <span class="back"><a href="11_ko.html" rel="prev">❮ 이전</a></span>
                    <span class="next"><a href="13_ko.html" rel="next">다음 ❯</a></span>
                </div>
                </div>
                <div class="code">
                <iframe id="rust-playground" width="100%" src="https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&code=fn%20main()%20%7B%0A%20%20%20%20let%20a%20%3D%2013u8%3B%0A%20%20%20%20let%20b%20%3D%207u32%3B%0A%20%20%20%20let%20c%20%3D%20a%20as%20u32%20%2B%20b%3B%0A%20%20%20%20println!(%22%7B%7D%22%2C%20c)%3B%0A%0A%20%20%20%20let%20t%20%3D%20true%3B%0A%20%20%20%20println!(%22%7B%7D%22%2C%20t%20as%20u8)%3B%0A%7D%0A" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals" title="Rust Playground" loading="lazy"></iframe>
                </div>
            </div>
            <script>
            var pres = document.querySelectorAll("pre>code");
            for (var i = 0; i < pres.length; i++) {
                hljs.highlightElement(pres[i]);
            }
            var options = {
                loadDelay: 0,
                copyIconClass: "far fa-clipboard",
                checkIconClass: "fa fa-check text-success",
                blogURL: "http://rust-study.ajousw.kr/"
            };
            window.highlightJsBadge(options);
            </script>
    
            <footer>
              <p><a target="_blank" rel="noopener" href="https://www.youtube.com/c/SoftwareToolTime">아주대학교 Software Tool Time</a> - Rust 튜토리얼 (Basic)</p>
            </footer>
        </body>
    </html>