Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0c2243f8a1696816431e7210e991fa52 > files > 720

rust-doc-1.35.0-1.mga7.armv7hl.rpm

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <title>Documentation</title>

    <link rel="stylesheet" type="text/css" href="../rust.css">

    <meta name="robots" content="noindex,follow">
<link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">


</head>
<body class="rustdoc">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    <div id="versioninfo">
  <img src="https://www.rust-lang.org/logos/rust-logo-32x32-blk.png" width="32" height="32" alt="Rust logo"><br>
  <span class="white-sticker"><a href="https://www.rust-lang.org">Rust</a> 1.35.0</span><br>
  <a href="https://github.com/rust-lang/rust/commit/"
    class="hash white-sticker"></a>
</div>


    <h1 class="title">Documentation</h1>
    <p><small>There is a new edition of the book and this is an old link.</small></p>
<blockquote>
<p>Documentation comments use <code>///</code> instead of <code>//</code> and support Markdown notation for formatting the text if you’d like.
You place documentation comments just before the item they are documenting.</p>
</blockquote>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="doccomment">/// Adds one to the number given.</span>
<span class="doccomment">///</span>
<span class="doccomment">/// # Examples</span>
<span class="doccomment">///</span>
<span class="doccomment">/// ```</span>
<span class="doccomment">/// let five = 5;</span>
<span class="doccomment">///</span>
<span class="doccomment">/// assert_eq!(6, my_crate::add_one(5));</span>
<span class="doccomment">/// ```</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_one</span>(<span class="ident">x</span>: <span class="ident">i32</span>) <span class="op">-&gt;</span> <span class="ident">i32</span> {
    <span class="ident">x</span> <span class="op">+</span> <span class="number">1</span>
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%2F%2F%2F%20Adds%20one%20to%20the%20number%20given.%0A%2F%2F%2F%0A%2F%2F%2F%20%23%20Examples%0A%2F%2F%2F%0A%2F%2F%2F%20%60%60%60%0A%2F%2F%2F%20let%20five%20%3D%205%3B%0A%2F%2F%2F%0A%2F%2F%2F%20assert_eq!(6%2C%20my_crate%3A%3Aadd_one(5))%3B%0A%2F%2F%2F%20%60%60%60%0Apub%20fn%20add_one(x%3A%20i32)%20-%3E%20i32%20%7B%0A%20%20%20%20x%20%2B%201%0A%7D%0A%7D">Run</a></pre></div>
<hr />
<p>You can find the latest version of this information
<a href="ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments">here</a>.</p>

    <footer><p>
Copyright &copy; 2011 The Rust Project Developers. Licensed under the
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
or the <a href="https://opensource.org/licenses/MIT">MIT license</a>, at your option.
</p><p>
This file may not be copied, modified, or distributed except according to those terms.
</p></footer>


</body>
</html>