title: Reversing a string in Rust
body: <p>What is wrong with this:</p>
  
  <pre><code>fn main() {
      let word: &amp;str = "lowks";
      assert_eq!(word.chars().rev(), "skwol");
  }
  </code></pre>
  
  <p>I get an error like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0369]: binary operation `==` cannot be applied to type `std::iter::Rev&lt;std::str::Chars&lt;'_&gt;&gt;`
   --&gt; src/main.rs:4:5
    |
  4 |     assert_eq!(word.chars().rev(), "skwol");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::cmp::PartialEq` might be missing for `std::iter::Rev&lt;std::str::Chars&lt;'_&gt;&gt;`
    = note: this error originates in a macro outside of the current crate
  </code></pre>
  
  <p>What is the correct way to do this?</p>