<p dir="auto">Currently multiple assignemnt is supported at declaration like this</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let (critPos, period) =
    if critPos1 &gt; critPos2 {
        (critPos1, period1)
    } else {
        (critPos2, period2)
    };"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-kos">(</span>critPos<span class="pl-kos">,</span> period<span class="pl-kos">)</span> =
    <span class="pl-k">if</span> critPos1 &gt; critPos2 <span class="pl-kos">{</span>
        <span class="pl-kos">(</span>critPos1<span class="pl-kos">,</span> period1<span class="pl-kos">)</span>
    <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
        <span class="pl-kos">(</span>critPos2<span class="pl-kos">,</span> period2<span class="pl-kos">)</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I think it would be nice to be able do something like this:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// &quot;improved&quot; version of  maximal_suffix in src/libcore/str.rs

fn maximal_suffix(arr: &amp;[u8], reversed: bool) -&gt; (uint, uint) {
    let mut left = -1; // Corresponds to i in the paper
    let mut right = 0; // Corresponds to j in the paper
    let mut offset = 1; // Corresponds to k in the paper
    let mut period = 1; // Corresponds to p in the paper

    while right + offset &lt; arr.len() {
        let (a, b) =
            if reversed {
                (arr[left + offset], arr[right + offset])
            } else {
                (arr[right + offset], arr[left + offset])
            };
        // THIS IS THE IMPORTANT PART
        (left, right, offset, period) =
            if a &lt; b {
                // Suffix is smaller, period is entire prefix so far.
                (left, right + offset, 1, right - left)
            } else if a == b {
                // Advance through repetition of the current period.
                if offset == period {
                    (left, right + offset, 1, period)
                } else {
                    (left, right, offset + 1, period)
                }
            } else {
                // Suffix is larger, start over from current location.
                (right, right + 1, 1, 1)
            };
    }
    (left + 1, period)
}"><pre class="notranslate"><span class="pl-c">// "improved" version of  maximal_suffix in src/libcore/str.rs</span>

<span class="pl-k">fn</span> <span class="pl-en">maximal_suffix</span><span class="pl-kos">(</span><span class="pl-s1">arr</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">reversed</span><span class="pl-kos">:</span> <span class="pl-smi">bool</span><span class="pl-kos">)</span> -&gt; <span class="pl-kos">(</span><span class="pl-smi">uint</span><span class="pl-kos">,</span> <span class="pl-smi">uint</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> left = -<span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to i in the paper</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> right = <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to j in the paper</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> offset = <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to k in the paper</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> period = <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to p in the paper</span>

    <span class="pl-k">while</span> right + offset &lt; arr<span class="pl-kos">.</span><span class="pl-en">len</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">let</span> <span class="pl-kos">(</span>a<span class="pl-kos">,</span> b<span class="pl-kos">)</span> =
            <span class="pl-k">if</span> reversed <span class="pl-kos">{</span>
                <span class="pl-kos">(</span>arr<span class="pl-kos">[</span>left + offset<span class="pl-kos">]</span><span class="pl-kos">,</span> arr<span class="pl-kos">[</span>right + offset<span class="pl-kos">]</span><span class="pl-kos">)</span>
            <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
                <span class="pl-kos">(</span>arr<span class="pl-kos">[</span>right + offset<span class="pl-kos">]</span><span class="pl-kos">,</span> arr<span class="pl-kos">[</span>left + offset<span class="pl-kos">]</span><span class="pl-kos">)</span>
            <span class="pl-kos">}</span><span class="pl-kos">;</span>
        <span class="pl-c">// THIS IS THE IMPORTANT PART</span>
        <span class="pl-kos">(</span>left<span class="pl-kos">,</span> right<span class="pl-kos">,</span> offset<span class="pl-kos">,</span> period<span class="pl-kos">)</span> =
            <span class="pl-k">if</span> a &lt; b <span class="pl-kos">{</span>
                <span class="pl-c">// Suffix is smaller, period is entire prefix so far.</span>
                <span class="pl-kos">(</span>left<span class="pl-kos">,</span> right + offset<span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> right - left<span class="pl-kos">)</span>
            <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> a == b <span class="pl-kos">{</span>
                <span class="pl-c">// Advance through repetition of the current period.</span>
                <span class="pl-k">if</span> offset == period <span class="pl-kos">{</span>
                    <span class="pl-kos">(</span>left<span class="pl-kos">,</span> right + offset<span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> period<span class="pl-kos">)</span>
                <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
                    <span class="pl-kos">(</span>left<span class="pl-kos">,</span> right<span class="pl-kos">,</span> offset + <span class="pl-c1">1</span><span class="pl-kos">,</span> period<span class="pl-kos">)</span>
                <span class="pl-kos">}</span>
            <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
                <span class="pl-c">// Suffix is larger, start over from current location.</span>
                <span class="pl-kos">(</span>right<span class="pl-kos">,</span> right + <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">)</span>
            <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-kos">(</span>left + <span class="pl-c1">1</span><span class="pl-kos">,</span> period<span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Currently something similar is at the moment only possible with a small workaround:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn maximal_suffix(arr: &amp;[u8], reversed: bool) -&gt; (uint, uint) {
    let mut left = -1; // Corresponds to i in the paper
    let mut right = 0; // Corresponds to j in the paper
    let mut offset = 1; // Corresponds to k in the paper
    let mut period = 1; // Corresponds to p in the paper

    while right + offset &lt; arr.len() {
        let (a, b) =
            if reversed {
                (arr[left + offset], arr[right + offset])
            } else {
                (arr[right + offset], arr[left + offset])
            };
        // HERE I NEED TO INTRODUCE TEMPORARY VARIABLES
        let (left_temp, right_temp, offset_temp, period_temp) =
            if a &lt; b {
                // Suffix is smaller, period is entire prefix so far.
                (left, right + offset, 1, right - left)
            } else if a == b {
                // Advance through repetition of the current period.
                if offset == period {
                    (left, right + offset, 1, period)
                } else {
                    (left, right, offset + 1, period)
                }
            } else {
                // Suffix is larger, start over from current location.
                (right, right + 1, 1, 1)
            };
        // AND NOW I CAN PUT THE VALUES BACK IN THE REAL VARIABLES
        left = left_temp;
        right = right_temp;
        offset = offset_temp;
        period = period_temp;
    }
    (left + 1, period)
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">maximal_suffix</span><span class="pl-kos">(</span><span class="pl-s1">arr</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">reversed</span><span class="pl-kos">:</span> <span class="pl-smi">bool</span><span class="pl-kos">)</span> -&gt; <span class="pl-kos">(</span><span class="pl-smi">uint</span><span class="pl-kos">,</span> <span class="pl-smi">uint</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> left = -<span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to i in the paper</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> right = <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to j in the paper</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> offset = <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to k in the paper</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> period = <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// Corresponds to p in the paper</span>

    <span class="pl-k">while</span> right + offset &lt; arr<span class="pl-kos">.</span><span class="pl-en">len</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">let</span> <span class="pl-kos">(</span>a<span class="pl-kos">,</span> b<span class="pl-kos">)</span> =
            <span class="pl-k">if</span> reversed <span class="pl-kos">{</span>
                <span class="pl-kos">(</span>arr<span class="pl-kos">[</span>left + offset<span class="pl-kos">]</span><span class="pl-kos">,</span> arr<span class="pl-kos">[</span>right + offset<span class="pl-kos">]</span><span class="pl-kos">)</span>
            <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
                <span class="pl-kos">(</span>arr<span class="pl-kos">[</span>right + offset<span class="pl-kos">]</span><span class="pl-kos">,</span> arr<span class="pl-kos">[</span>left + offset<span class="pl-kos">]</span><span class="pl-kos">)</span>
            <span class="pl-kos">}</span><span class="pl-kos">;</span>
        <span class="pl-c">// HERE I NEED TO INTRODUCE TEMPORARY VARIABLES</span>
        <span class="pl-k">let</span> <span class="pl-kos">(</span>left_temp<span class="pl-kos">,</span> right_temp<span class="pl-kos">,</span> offset_temp<span class="pl-kos">,</span> period_temp<span class="pl-kos">)</span> =
            <span class="pl-k">if</span> a &lt; b <span class="pl-kos">{</span>
                <span class="pl-c">// Suffix is smaller, period is entire prefix so far.</span>
                <span class="pl-kos">(</span>left<span class="pl-kos">,</span> right + offset<span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> right - left<span class="pl-kos">)</span>
            <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> a == b <span class="pl-kos">{</span>
                <span class="pl-c">// Advance through repetition of the current period.</span>
                <span class="pl-k">if</span> offset == period <span class="pl-kos">{</span>
                    <span class="pl-kos">(</span>left<span class="pl-kos">,</span> right + offset<span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> period<span class="pl-kos">)</span>
                <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
                    <span class="pl-kos">(</span>left<span class="pl-kos">,</span> right<span class="pl-kos">,</span> offset + <span class="pl-c1">1</span><span class="pl-kos">,</span> period<span class="pl-kos">)</span>
                <span class="pl-kos">}</span>
            <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
                <span class="pl-c">// Suffix is larger, start over from current location.</span>
                <span class="pl-kos">(</span>right<span class="pl-kos">,</span> right + <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">)</span>
            <span class="pl-kos">}</span><span class="pl-kos">;</span>
        <span class="pl-c">// AND NOW I CAN PUT THE VALUES BACK IN THE REAL VARIABLES</span>
        left = left_temp<span class="pl-kos">;</span>
        right = right_temp<span class="pl-kos">;</span>
        offset = offset_temp<span class="pl-kos">;</span>
        period = period_temp<span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-kos">(</span>left + <span class="pl-c1">1</span><span class="pl-kos">,</span> period<span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">How about we add a new command line option to change the entry point from "fn main()" to another?</p>
<p dir="auto">for example<br>
$ rustc a.rs --entry=myEntry</p>