title: The trait bound io::Error: Clone is not satisfied when implementing a custom error enum
body: <p>I am receiving the following error when implementing a custom error type: </p>
  
  <pre class="lang-none prettyprint-override"><code>the trait bound `std::io::Error: std::clone::Clone` is not satisfied
  </code></pre>
  
  <p>Here is my custom error enum:</p>
  
  <pre><code>use std::fmt;
  use std::io;
  use crate::memtable::Memtable;
  
  // Define our error types. These may be customized for our error handling cases.
  // Now we will be able to write our own errors, defer to an underlying error
  // implementation, or do something in between.
  #[derive(Debug, Clone)]
  pub enum MemtableError {
      Io(io::Error),
      FromUTF8(std::string::FromUtf8Error),
      NotFound,
  }
  
  // Generation of an error is completely separate from how it is displayed.
  // There's no need to be concerned about cluttering complex logic with the display style.
  //
  // Note that we don't store any extra info about the errors. This means we can't state
  // which string failed to parse without modifying our types to carry that information.
  impl fmt::Display for MemtableError {
      fn fmt(&amp;self, f: &amp;mut fmt::Formatter) -&gt; fmt::Result {
          write!(f, "Some error occurred!");
          Ok(())
      }
  }
  
  // a test function that returns our error result
  fn raises_my_error(memtable: Memtable, key: String) -&gt; Result&lt;(),MemtableError&gt; {
      match memtable.read(key) {
          Ok(v) =&gt; Ok(()),
          Err(e) =&gt; Err(e),
      }
  }
  </code></pre>
  
  <p>What am I doing wrong? I tried following these examples: </p>
  
  <ol>
  <li><a href="https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/define_error_type.html" rel="nofollow noreferrer">https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/define_error_type.html</a></li>
  <li><a href="https://learning-rust.github.io/docs/e7.custom_error_types.html" rel="nofollow noreferrer">https://learning-rust.github.io/docs/e7.custom_error_types.html</a></li>
  <li><a href="https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/wrap_error.html" rel="nofollow noreferrer">https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/wrap_error.html</a></li>
  </ol>