1<!DOCTYPE html> 2<html lang="en"> 3<head> 4<meta charset="UTF-8"> 5<title>sampleFile - OpenGrok cross reference for /sampleFile</title></head><body> 6<script type="text/javascript">/* <![CDATA[ */ 7function get_sym_list(){return [["Variable","xv",[["bytes",44],["state",45]]],["Enum","xe",[["State",25]]],["Function","xf",[["b",108],["unescape",41],["unescape_carriage",128],["unescape_nl",118],["unescape_nothing_hex0",138],["unescape_nothing_hex1",143],["unescape_nothing_hex2",148],["unescape_nothing_simple",133],["unescape_nul",113],["unescape_tab",123]]]];} /* ]]> */</script><a class="l" name="1" href="#1">1</a><span class='fold-space'> </span><span class="c">// The MIT License (MIT)</span> 8<a class="l" name="2" href="#2">2</a><span class='fold-space'> </span><span class="c">//</span> 9<a class="l" name="3" href="#3">3</a><span class='fold-space'> </span><span class="c">// Copyright (c) 2015 Andrew Gallant</span> 10<a class="l" name="4" href="#4">4</a><span class='fold-space'> </span><span class="c">//</span> 11<a class="l" name="5" href="#5">5</a><span class='fold-space'> </span><span class="c">// Permission is hereby granted, free of charge, to any person obtaining a copy</span> 12<a class="l" name="6" href="#6">6</a><span class='fold-space'> </span><span class="c">// of this software and associated documentation files (the "Software"), to deal</span> 13<a class="l" name="7" href="#7">7</a><span class='fold-space'> </span><span class="c">// in the Software without restriction, including without limitation the rights</span> 14<a class="l" name="8" href="#8">8</a><span class='fold-space'> </span><span class="c">// to use, copy, modify, merge, publish, distribute, sublicense, <a href="/source/s?path=and/">and</a>/<a href="/source/s?path=and/or">or</a> sell</span> 15<a class="l" name="9" href="#9">9</a><span class='fold-space'> </span><span class="c">// copies of the Software, and to permit persons to whom the Software is</span> 16<a class="hl" name="10" href="#10">10</a><span class='fold-space'> </span><span class="c">// furnished to do so, subject to the following conditions:</span> 17<a class="l" name="11" href="#11">11</a><span class='fold-space'> </span><span class="c">//</span> 18<a class="l" name="12" href="#12">12</a><span class='fold-space'> </span><span class="c">// The above copyright notice and this permission notice shall be included in</span> 19<a class="l" name="13" href="#13">13</a><span class='fold-space'> </span><span class="c">// all copies or substantial portions of the Software.</span> 20<a class="l" name="14" href="#14">14</a><span class='fold-space'> </span><span class="c">//</span> 21<a class="l" name="15" href="#15">15</a><span class='fold-space'> </span><span class="c">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span> 22<a class="l" name="16" href="#16">16</a><span class='fold-space'> </span><span class="c">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span> 23<a class="l" name="17" href="#17">17</a><span class='fold-space'> </span><span class="c">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span> 24<a class="l" name="18" href="#18">18</a><span class='fold-space'> </span><span class="c">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span> 25<a class="l" name="19" href="#19">19</a><span class='fold-space'> </span><span class="c">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span> 26<a class="hl" name="20" href="#20">20</a><span class='fold-space'> </span><span class="c">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span> 27<a class="l" name="21" href="#21">21</a><span class='fold-space'> </span><span class="c">// THE SOFTWARE.</span> 28<a class="l" name="22" href="#22">22</a><span class='fold-space'> </span> 29<a class="l" name="23" href="#23">23</a><span class='fold-space'> </span><span class="c">/// A single state in the state machine used by `unescape`.</span> 30<a class="l" name="24" href="#24">24</a><span class='fold-space'> </span>#[<a href="/source/s?defs=derive" class="intelliWindow-symbol" data-definition-place="undefined-in-file">derive</a>(<a href="/source/s?defs=Clone" class="intelliWindow-symbol" data-definition-place="undefined-in-file">Clone</a>, <a href="/source/s?defs=Copy" class="intelliWindow-symbol" data-definition-place="undefined-in-file">Copy</a>, <a href="/source/s?defs=Eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">Eq</a>, <a href="/source/s?defs=PartialEq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">PartialEq</a>)] 31<a class="l" name="25" href="#25">25</a><span class='fold-space'> </span><b>enum</b> <a class="xe" name="State"/><a href="/source/s?refs=State" class="xe intelliWindow-symbol" data-definition-place="def">State</a> { 32<a class="l" name="26" href="#26">26</a><span class='fold-space'> </span> <span class="c">/// The state after seeing a `\`.</span> 33<a class="l" name="27" href="#27">27</a><span class='fold-space'> </span> <a class="xer" name="Escape"/><a href="/source/s?refs=Escape" class="xer intelliWindow-symbol" data-definition-place="def">Escape</a>, 34<a class="l" name="28" href="#28">28</a><span class='fold-space'> </span> <span class="c">/// The state after seeing a `\x`.</span> 35<a class="l" name="29" href="#29">29</a><span class='fold-space'> </span> <a class="xer" name="HexFirst"/><a href="/source/s?refs=HexFirst" class="xer intelliWindow-symbol" data-definition-place="def">HexFirst</a>, 36<a class="hl" name="30" href="#30">30</a><span class='fold-space'> </span> <span class="c">/// The state after seeing a `\x[0-9A-Fa-f]`.</span> 37<a class="l" name="31" href="#31">31</a><span class='fold-space'> </span> <a class="xer" name="HexSecond"/><a href="/source/s?refs=HexSecond" class="xer intelliWindow-symbol" data-definition-place="def">HexSecond</a>(<a href="/source/s?defs=char" class="intelliWindow-symbol" data-definition-place="undefined-in-file">char</a>), 38<a class="l" name="32" href="#32">32</a><span class='fold-space'> </span> <span class="c">/// Default state.</span> 39<a class="l" name="33" href="#33">33</a><span class='fold-space'> </span> <a class="xer" name="Literal"/><a href="/source/s?refs=Literal" class="xer intelliWindow-symbol" data-definition-place="def">Literal</a>, 40<a class="l" name="34" href="#34">34</a><span class='fold-space'> </span>} 41<a class="l" name="35" href="#35">35</a><span class='fold-space'> </span> 42<a class="l" name="36" href="#36">36</a><span class='fold-space'> </span><span class="c">/// Unescapes a string given on the command line. It supports a limited set of</span> 43<a class="l" name="37" href="#37">37</a><span class='fold-space'> </span><span class="c">/// escape sequences:</span> 44<a class="l" name="38" href="#38">38</a><span class='fold-space'> </span><span class="c">///</span> 45<a class="l" name="39" href="#39">39</a><span class='fold-space'> </span><span class="c">/// * \t, \r and \n are mapped to their corresponding ASCII bytes.</span> 46<a class="hl" name="40" href="#40">40</a><span class='fold-space'> </span><span class="c">/// * \xZZ hexadecimal escapes are mapped to their byte.</span> 47<span id='scope_id_fc845eae' class='scope-head'><span class='scope-signature'>unescape(s: &str) -> Vec<u8></span><a class="l" name="41" href="#41">41</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_fc845eae_fold_icon'><span class='fold-icon'> </span></a><b>pub</b> <b>fn</b> <a class="xf" name="unescape"/><a href="/source/s?refs=unescape" class="xf intelliWindow-symbol" data-definition-place="def">unescape</a>(<a href="/source/s?defs=s" class="intelliWindow-symbol" data-definition-place="undefined-in-file">s</a>: &<a href="/source/s?defs=str" class="intelliWindow-symbol" data-definition-place="undefined-in-file">str</a>) -> <a href="/source/s?defs=Vec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">Vec</a><<a class="xa" name="u8"/><a href="/source/s?refs=u8" class="xa intelliWindow-symbol" data-definition-place="def">u8</a>> {</span> 48<span id='scope_id_fc845eae_fold' class='scope-body'><a class="l" name="42" href="#42">42</a><span class='fold-space'> </span> <b>use</b> <b>self</b>::<a class="d intelliWindow-symbol" href="#State" data-definition-place="defined-in-file">State</a>::*; 49<a class="l" name="43" href="#43">43</a><span class='fold-space'> </span> 50<a class="l" name="44" href="#44">44</a><span class='fold-space'> </span> <b>let</b> <b>mut</b> <a class="xv" name="bytes"/><a href="/source/s?refs=bytes" class="xv intelliWindow-symbol" data-definition-place="def">bytes</a> = <a href="/source/s?defs=vec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">vec</a>![]; 51<a class="l" name="45" href="#45">45</a><span class='fold-space'> </span> <b>let</b> <b>mut</b> <a class="xv" name="state"/><a href="/source/s?refs=state" class="xv intelliWindow-symbol" data-definition-place="def">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; 52<a class="l" name="46" href="#46">46</a><span class='fold-space'> </span> <b>for</b> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> <b>in</b> <a href="/source/s?defs=s" class="intelliWindow-symbol" data-definition-place="undefined-in-file">s</a>.<a href="/source/s?defs=chars" class="intelliWindow-symbol" data-definition-place="undefined-in-file">chars</a>() { 53<a class="l" name="47" href="#47">47</a><span class='fold-space'> </span> <b>match</b> <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> { 54<a class="l" name="48" href="#48">48</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#Escape" data-definition-place="defined-in-file">Escape</a> => { 55<a class="l" name="49" href="#49">49</a><span class='fold-space'> </span> <b>match</b> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> { 56<a class="hl" name="50" href="#50">50</a><span class='fold-space'> </span> <span class="s">'n'</span> => { <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=push" class="intelliWindow-symbol" data-definition-place="undefined-in-file">push</a>(<span class="s">b'\n'</span>); <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; } 57<a class="l" name="51" href="#51">51</a><span class='fold-space'> </span> <span class="s">'r'</span> => { <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=push" class="intelliWindow-symbol" data-definition-place="undefined-in-file">push</a>(<span class="s">b'\r'</span>); <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; } 58<a class="l" name="52" href="#52">52</a><span class='fold-space'> </span> <span class="s">'t'</span> => { <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=push" class="intelliWindow-symbol" data-definition-place="undefined-in-file">push</a>(<span class="s">b'\t'</span>); <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; } 59<a class="l" name="53" href="#53">53</a><span class='fold-space'> </span> <span class="s">'x'</span> => { <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#HexFirst" data-definition-place="defined-in-file">HexFirst</a>; } 60<a class="l" name="54" href="#54">54</a><span class='fold-space'> </span> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> => { 61<a class="l" name="55" href="#55">55</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=extend" class="intelliWindow-symbol" data-definition-place="undefined-in-file">extend</a>(<a href="/source/s?defs=format" class="intelliWindow-symbol" data-definition-place="undefined-in-file">format</a>!(<span class="s">r"\{}"</span>, <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>).<a href="/source/s?defs=into_bytes" class="intelliWindow-symbol" data-definition-place="undefined-in-file">into_bytes</a>()); 62<a class="l" name="56" href="#56">56</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; 63<a class="l" name="57" href="#57">57</a><span class='fold-space'> </span> } 64<a class="l" name="58" href="#58">58</a><span class='fold-space'> </span> } 65<a class="l" name="59" href="#59">59</a><span class='fold-space'> </span> } 66<a class="hl" name="60" href="#60">60</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#HexFirst" data-definition-place="defined-in-file">HexFirst</a> => { 67<a class="l" name="61" href="#61">61</a><span class='fold-space'> </span> <b>match</b> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> { 68<a class="l" name="62" href="#62">62</a><span class='fold-space'> </span> <span class="s">'0'</span>...<span class="s">'9'</span> | <span class="s">'A'</span>...<span class="s">'F'</span> | <span class="s">'a'</span>...<span class="s">'f'</span> => { 69<a class="l" name="63" href="#63">63</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#HexSecond" data-definition-place="defined-in-file">HexSecond</a>(<a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>); 70<a class="l" name="64" href="#64">64</a><span class='fold-space'> </span> } 71<a class="l" name="65" href="#65">65</a><span class='fold-space'> </span> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> => { 72<a class="l" name="66" href="#66">66</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=extend" class="intelliWindow-symbol" data-definition-place="undefined-in-file">extend</a>(<a href="/source/s?defs=format" class="intelliWindow-symbol" data-definition-place="undefined-in-file">format</a>!(<span class="s">r"\x{}"</span>, <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>).<a href="/source/s?defs=into_bytes" class="intelliWindow-symbol" data-definition-place="undefined-in-file">into_bytes</a>()); 73<a class="l" name="67" href="#67">67</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; 74<a class="l" name="68" href="#68">68</a><span class='fold-space'> </span> } 75<a class="l" name="69" href="#69">69</a><span class='fold-space'> </span> } 76<a class="hl" name="70" href="#70">70</a><span class='fold-space'> </span> } 77<a class="l" name="71" href="#71">71</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#HexSecond" data-definition-place="defined-in-file">HexSecond</a>(<a href="/source/s?defs=first" class="intelliWindow-symbol" data-definition-place="undefined-in-file">first</a>) => { 78<a class="l" name="72" href="#72">72</a><span class='fold-space'> </span> <b>match</b> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> { 79<a class="l" name="73" href="#73">73</a><span class='fold-space'> </span> <span class="s">'0'</span>...<span class="s">'9'</span> | <span class="s">'A'</span>...<span class="s">'F'</span> | <span class="s">'a'</span>...<span class="s">'f'</span> => { 80<a class="l" name="74" href="#74">74</a><span class='fold-space'> </span> <b>let</b> <a href="/source/s?defs=ordinal" class="intelliWindow-symbol" data-definition-place="undefined-in-file">ordinal</a> = <a href="/source/s?defs=format" class="intelliWindow-symbol" data-definition-place="undefined-in-file">format</a>!(<span class="s">"{}{}"</span>, <a href="/source/s?defs=first" class="intelliWindow-symbol" data-definition-place="undefined-in-file">first</a>, <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>); 81<a class="l" name="75" href="#75">75</a><span class='fold-space'> </span> <b>let</b> <a href="/source/s?defs=byte" class="intelliWindow-symbol" data-definition-place="undefined-in-file">byte</a> = <a href="/source/s?defs=u8" class="intelliWindow-symbol" data-definition-place="undefined-in-file">u8</a>::<a href="/source/s?defs=from_str_radix" class="intelliWindow-symbol" data-definition-place="undefined-in-file">from_str_radix</a>(&<a href="/source/s?defs=ordinal" class="intelliWindow-symbol" data-definition-place="undefined-in-file">ordinal</a>, <span class="n">16</span>).<a href="/source/s?defs=unwrap" class="intelliWindow-symbol" data-definition-place="undefined-in-file">unwrap</a>(); 82<a class="l" name="76" href="#76">76</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=push" class="intelliWindow-symbol" data-definition-place="undefined-in-file">push</a>(<a href="/source/s?defs=byte" class="intelliWindow-symbol" data-definition-place="undefined-in-file">byte</a>); 83<a class="l" name="77" href="#77">77</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; 84<a class="l" name="78" href="#78">78</a><span class='fold-space'> </span> <a href="/source/s?defs=byte" class="intelliWindow-symbol" data-definition-place="undefined-in-file">byte</a> = <span class="n">0xFF</span> + <span class="n">0b1</span> - <span class="n">0o1u8</span>; 85<a class="l" name="79" href="#79">79</a><span class='fold-space'> </span> } 86<a class="hl" name="80" href="#80">80</a><span class='fold-space'> </span> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> => { 87<a class="l" name="81" href="#81">81</a><span class='fold-space'> </span> <b>let</b> <a href="/source/s?defs=original" class="intelliWindow-symbol" data-definition-place="undefined-in-file">original</a> = <a href="/source/s?defs=format" class="intelliWindow-symbol" data-definition-place="undefined-in-file">format</a>!(<span class="s">r"\x{}{}"</span>, <a href="/source/s?defs=first" class="intelliWindow-symbol" data-definition-place="undefined-in-file">first</a>, <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>); 88<a class="l" name="82" href="#82">82</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=extend" class="intelliWindow-symbol" data-definition-place="undefined-in-file">extend</a>(<a href="/source/s?defs=original" class="intelliWindow-symbol" data-definition-place="undefined-in-file">original</a>.<a href="/source/s?defs=into_bytes" class="intelliWindow-symbol" data-definition-place="undefined-in-file">into_bytes</a>()); 89<a class="l" name="83" href="#83">83</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a>; 90<a class="l" name="84" href="#84">84</a><span class='fold-space'> </span> } 91<a class="l" name="85" href="#85">85</a><span class='fold-space'> </span> } 92<a class="l" name="86" href="#86">86</a><span class='fold-space'> </span> } 93<a class="l" name="87" href="#87">87</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a> => { 94<a class="l" name="88" href="#88">88</a><span class='fold-space'> </span> <b>match</b> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> { 95<a class="l" name="89" href="#89">89</a><span class='fold-space'> </span> <span class="s">'\\'</span> => { <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> = <a class="d intelliWindow-symbol" href="#Escape" data-definition-place="defined-in-file">Escape</a>; } 96<a class="hl" name="90" href="#90">90</a><span class='fold-space'> </span> <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a> => { <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=extend" class="intelliWindow-symbol" data-definition-place="undefined-in-file">extend</a>(<a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>.<a href="/source/s?defs=to_string" class="intelliWindow-symbol" data-definition-place="undefined-in-file">to_string</a>().<a href="/source/s?defs=as_bytes" class="intelliWindow-symbol" data-definition-place="undefined-in-file">as_bytes</a>()); } 97<a class="l" name="91" href="#91">91</a><span class='fold-space'> </span> } 98<a class="l" name="92" href="#92">92</a><span class='fold-space'> </span> } 99<a class="l" name="93" href="#93">93</a><span class='fold-space'> </span> } 100<a class="l" name="94" href="#94">94</a><span class='fold-space'> </span> } 101<a class="l" name="95" href="#95">95</a><span class='fold-space'> </span> <b>match</b> <a class="d intelliWindow-symbol" href="#state" data-definition-place="defined-in-file">state</a> { 102<a class="l" name="96" href="#96">96</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#Escape" data-definition-place="defined-in-file">Escape</a> => <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=push" class="intelliWindow-symbol" data-definition-place="undefined-in-file">push</a>(<span class="s">b'\\'</span>), 103<a class="l" name="97" href="#97">97</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#HexFirst" data-definition-place="defined-in-file">HexFirst</a> => <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=extend" class="intelliWindow-symbol" data-definition-place="undefined-in-file">extend</a>(<span class="s">b"\\x"</span>), 104<a class="l" name="98" href="#98">98</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#HexSecond" data-definition-place="defined-in-file">HexSecond</a>(<a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>) => <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=extend" class="intelliWindow-symbol" data-definition-place="undefined-in-file">extend</a>(<a href="/source/s?defs=format" class="intelliWindow-symbol" data-definition-place="undefined-in-file">format</a>!(<span class="s">"\\x{}"</span>, <a href="/source/s?defs=c" class="intelliWindow-symbol" data-definition-place="undefined-in-file">c</a>).<a href="/source/s?defs=into_bytes" class="intelliWindow-symbol" data-definition-place="undefined-in-file">into_bytes</a>()), 105<a class="l" name="99" href="#99">99</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#Literal" data-definition-place="defined-in-file">Literal</a> => {} 106<a class="hl" name="100" href="#100">100</a><span class='fold-space'> </span> } 107<a class="l" name="101" href="#101">101</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a> 108<a class="l" name="102" href="#102">102</a><span class='fold-space'> </span>} 109</span><a class="l" name="103" href="#103">103</a><span class='fold-space'> </span> 110<a class="l" name="104" href="#104">104</a><span class='fold-space'> </span>#[<a href="/source/s?defs=cfg" class="intelliWindow-symbol" data-definition-place="undefined-in-file">cfg</a>(<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>)] 111<a class="l" name="105" href="#105">105</a><span class='fold-space'> </span><b>mod</b> <a class="d" name="tests"/><a href="/source/s?refs=tests" class="d intelliWindow-symbol" data-definition-place="def">tests</a> { 112<a class="l" name="106" href="#106">106</a><span class='fold-space'> </span> <b>use</b> <b>super</b>::<a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>; 113<a class="l" name="107" href="#107">107</a><span class='fold-space'> </span> 114<span id='scope_id_12399a19' class='scope-head'><span class='scope-signature'>b(bytes: &'static [u8]) -> Vec<u8></span><a class="l" name="108" href="#108">108</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_12399a19_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="b"/><a href="/source/s?refs=b" class="xf intelliWindow-symbol" data-definition-place="def">b</a>(<a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>: &'<b>static</b> [<a class="xa" name="u8"/><a href="/source/s?refs=u8" class="xa intelliWindow-symbol" data-definition-place="def">u8</a>]) -> <a href="/source/s?defs=Vec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">Vec</a><<a href="/source/s?defs=u8" class="intelliWindow-symbol" data-definition-place="undefined-in-file">u8</a>> {</span> 115<span id='scope_id_12399a19_fold' class='scope-body'><a class="l" name="109" href="#109">109</a><span class='fold-space'> </span> <a class="d intelliWindow-symbol" href="#bytes" data-definition-place="defined-in-file">bytes</a>.<a href="/source/s?defs=to_vec" class="intelliWindow-symbol" data-definition-place="undefined-in-file">to_vec</a>() 116<a class="hl" name="110" href="#110">110</a><span class='fold-space'> </span> } 117</span><a class="l" name="111" href="#111">111</a><span class='fold-space'> </span> 118<a class="l" name="112" href="#112">112</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 119<span id='scope_id_c6b0b3f4' class='scope-head'><span class='scope-signature'>unescape_nul()</span><a class="l" name="113" href="#113">113</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_c6b0b3f4_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_nul"/><a href="/source/s?refs=unescape_nul" class="xf intelliWindow-symbol" data-definition-place="def">unescape_nul</a>() {</span> 120<span id='scope_id_c6b0b3f4_fold' class='scope-body'><a class="l" name="114" href="#114">114</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\x00"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r"\x00"</span>)); 121<a class="l" name="115" href="#115">115</a><span class='fold-space'> </span> } 122</span><a class="l" name="116" href="#116">116</a><span class='fold-space'> </span> 123<a class="l" name="117" href="#117">117</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 124<span id='scope_id_1d28ecec' class='scope-head'><span class='scope-signature'>unescape_nl()</span><a class="l" name="118" href="#118">118</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_1d28ecec_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_nl"/><a href="/source/s?refs=unescape_nl" class="xf intelliWindow-symbol" data-definition-place="def">unescape_nl</a>() {</span> 125<span id='scope_id_1d28ecec_fold' class='scope-body'><a class="l" name="119" href="#119">119</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\n"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r"\n"</span>)); 126<a class="hl" name="120" href="#120">120</a><span class='fold-space'> </span> } 127</span><a class="l" name="121" href="#121">121</a><span class='fold-space'> </span> 128<a class="l" name="122" href="#122">122</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 129<span id='scope_id_a88de1e3' class='scope-head'><span class='scope-signature'>unescape_tab()</span><a class="l" name="123" href="#123">123</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_a88de1e3_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_tab"/><a href="/source/s?refs=unescape_tab" class="xf intelliWindow-symbol" data-definition-place="def">unescape_tab</a>() {</span> 130<span id='scope_id_a88de1e3_fold' class='scope-body'><a class="l" name="124" href="#124">124</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\t"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r"\t"</span>)); 131<a class="l" name="125" href="#125">125</a><span class='fold-space'> </span> } 132</span><a class="l" name="126" href="#126">126</a><span class='fold-space'> </span> 133<a class="l" name="127" href="#127">127</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 134<span id='scope_id_a5f8d183' class='scope-head'><span class='scope-signature'>unescape_carriage()</span><a class="l" name="128" href="#128">128</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_a5f8d183_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_carriage"/><a href="/source/s?refs=unescape_carriage" class="xf intelliWindow-symbol" data-definition-place="def">unescape_carriage</a>() {</span> 135<span id='scope_id_a5f8d183_fold' class='scope-body'><a class="l" name="129" href="#129">129</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\r"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r"\r"</span>)); 136<a class="hl" name="130" href="#130">130</a><span class='fold-space'> </span> } 137</span><a class="l" name="131" href="#131">131</a><span class='fold-space'> </span> 138<a class="l" name="132" href="#132">132</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 139<span id='scope_id_11030a79' class='scope-head'><span class='scope-signature'>unescape_nothing_simple()</span><a class="l" name="133" href="#133">133</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_11030a79_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_nothing_simple"/><a href="/source/s?refs=unescape_nothing_simple" class="xf intelliWindow-symbol" data-definition-place="def">unescape_nothing_simple</a>() {</span> 140<span id='scope_id_11030a79_fold' class='scope-body'><a class="l" name="134" href="#134">134</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\\a"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r"\a"</span>)); 141<a class="l" name="135" href="#135">135</a><span class='fold-space'> </span> } 142</span><a class="l" name="136" href="#136">136</a><span class='fold-space'> </span> 143<a class="l" name="137" href="#137">137</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 144<span id='scope_id_af842857' class='scope-head'><span class='scope-signature'>unescape_nothing_hex0()</span><a class="l" name="138" href="#138">138</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_af842857_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_nothing_hex0"/><a href="/source/s?refs=unescape_nothing_hex0" class="xf intelliWindow-symbol" data-definition-place="def">unescape_nothing_hex0</a>() {</span> 145<span id='scope_id_af842857_fold' class='scope-body'><a class="l" name="139" href="#139">139</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\\x"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r"\x"</span>)); 146<a class="hl" name="140" href="#140">140</a><span class='fold-space'> </span> } 147</span><a class="l" name="141" href="#141">141</a><span class='fold-space'> </span> 148<a class="l" name="142" href="#142">142</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 149<span id='scope_id_47acaebe' class='scope-head'><span class='scope-signature'>unescape_nothing_hex1()</span><a class="l" name="143" href="#143">143</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_47acaebe_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_nothing_hex1"/><a href="/source/s?refs=unescape_nothing_hex1" class="xf intelliWindow-symbol" data-definition-place="def">unescape_nothing_hex1</a>() {</span> 150<span id='scope_id_47acaebe_fold' class='scope-body'><a class="l" name="144" href="#144">144</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\\xz"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r"\xz"</span>)); 151<a class="l" name="145" href="#145">145</a><span class='fold-space'> </span> } 152</span><a class="l" name="146" href="#146">146</a><span class='fold-space'> </span> 153<a class="l" name="147" href="#147">147</a><span class='fold-space'> </span> #[<a href="/source/s?defs=test" class="intelliWindow-symbol" data-definition-place="undefined-in-file">test</a>] 154<span id='scope_id_33b47cda' class='scope-head'><span class='scope-signature'>unescape_nothing_hex2()</span><a class="l" name="148" href="#148">148</a><a style='cursor:pointer;' onclick='fold(this.parentNode.id)' id='scope_id_33b47cda_fold_icon'><span class='fold-icon'> </span></a> <b>fn</b> <a class="xf" name="unescape_nothing_hex2"/><a href="/source/s?refs=unescape_nothing_hex2" class="xf intelliWindow-symbol" data-definition-place="def">unescape_nothing_hex2</a>() {</span> 155<span id='scope_id_33b47cda_fold' class='scope-body'><a class="l" name="149" href="#149">149</a><span class='fold-space'> </span> <a href="/source/s?defs=assert_eq" class="intelliWindow-symbol" data-definition-place="undefined-in-file">assert_eq</a>!(<a class="d intelliWindow-symbol" href="#b" data-definition-place="defined-in-file">b</a>(<span class="s">b"\\xzz"</span>), <a class="d intelliWindow-symbol" href="#unescape" data-definition-place="defined-in-file">unescape</a>(<span class="s">r##"\xzz"##</span>##)); 156<a class="hl" name="150" href="#150">150</a><span class='fold-space'> </span> } 157</span><a class="l" name="151" href="#151">151</a><span class='fold-space'> </span> 158<a class="l" name="152" href="#152">152</a><span class='fold-space'> </span> <span class="c">/* /* */ /** */ 159<a class="l" name="153" href="#153">153</a><span class='fold-space'> </span> pub mod dummy_item {} /*! */ */</span> 160<a class="l" name="154" href="#154">154</a><span class='fold-space'> </span>} 161<a class="l" name="155" href="#155">155</a><span class='fold-space'> </span><span class="c">/*<a href="http://example.com">http://example.com</a>*/</span> 162<a class="l" name="156" href="#156">156</a><span class='fold-space'> </span></body> 163</html> 164