title: Why does slice::binary_search return an incorrect result?
body: <p>In the program below <code>binary_search</code> returns <code>Err(2)</code> rather than the expected <code>Ok(0)</code>. Is this a bug?</p>
  <pre><code>fn main() {
      let x = vec![&quot;slot&quot;, &quot;s&quot;];
      let u =  x.binary_search(&amp;&quot;slot&quot;);
      println!(&quot;{:?}&quot;, u);
  }
  </code></pre>