title: Substrate - cannot find type `Vec` in this scope
body: <p>I'm trying to play around with the substrate node template example and add some custom structs around.</p>
  <p>However, I get the following compilation error:</p>
  <p>&quot;cannot find type <code>Vec</code> in this scope&quot;</p>
  <p>And example of the struct being used (+ associated traits and where I'm importing them from) is:</p>
  <pre><code>    use codec::{Encode, Decode};
      use scale_info::TypeInfo;
  
      // , WrapperTypeDecode, WrapperTypeEncode, TypeInfo
      #[derive(Encode, Decode, Default, Clone, PartialEq, TypeInfo)]
      #[cfg_attr(feature = &quot;std&quot;, derive(Debug))]
      pub struct Image {
          // Note: Consider changing to JPG compression in the future
          pixels: Vec&lt;Vec&lt;(u8, u8, u8)&gt;&gt;,
          height: u32,
          width: u32
      }
  </code></pre>
  <p>But given that substrate requires quite a lot of bootstrapping I can't provide a working example.</p>
  <p>The one thing I tried is adding <code>#[cfg(feature = &quot;std&quot;)]</code> which afacit should have enabled either the rust std <em>or</em> the <code>std</code> defined in the <code>Cargo.toml</code>, I'm honestly unsure which. But it didn't help.</p>
  <p>My main question is... how do I fix this? What imports am I missing where?</p>
  <p>My secondary more important question is why would this be happening? Inside the <a href="https://docs.substrate.io/tutorials/v3/kitties/pt1/" rel="nofollow noreferrer">https://docs.substrate.io/tutorials/v3/kitties/pt1/</a> tutorial <code>vec!</code> and <code>Vec</code> seem to be used without any issues or further additions... Or rather, the one addition I see is <code>#[cfg(feature = &quot;std&quot;)]</code> being used before all impl blocks that use <code>vec!</code> but not before using <code>Vec</code>. Why is this the case? Is this simply allowing a block to import anything from the rust std? Or does it refer to the <code>std</code> defined in the <code>Cargo.toml</code> ? Why would it be necessary for <code>vec!</code> but not <code>Vec</code> ?</p>