title: How to access a field of a struct within a struct?
body: <p>I have a struct container of <code>Child</code>ren and a method <code>pop()</code> that removes the last added <code>Child</code> and returns it's <code>a</code> value:</p>
  
  <pre><code>struct Child {
      a: i32,
      b: String,
  }
  
  struct Container&lt;'a&gt; {
      vector: &amp;'a mut Vec&lt;Child&gt;,
  }
  
  impl&lt;'a&gt; Container&lt;'a&gt; {
      fn pop(&amp;mut self) -&gt; i32 {
          return self.vector.pop().a;
      }
  }
  </code></pre>
  
  <p>I get the error during compilation:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: no field `a` on type `std::option::Option&lt;Child&gt;`
    --&gt; src/main.rs:12:34
     |
  12 |         return self.vector.pop().a;
     |                                  ^
  </code></pre>
  
  <p>Does the scope of <code>Container</code>'s <code>pop()</code> not allow access to values of its  <code>Child</code>ren's scope?</p>