title: Mutable Struct Fields
body: <p>I know mutable fields were removed in 0.6. I'm getting the following error with this code,</p>
  
  <blockquote>
    <p>C:\Users\mflamer\Dropbox\Rust\Tests\gmap.rs:23:8: 23:18 error:
    assigning to immutable field
    C:\Users\mflamer\Dropbox\Rust\Tests\gmap.rs:23         dart.alpha =
    vec::from_elem(self.n + 1, dart);</p>
  </blockquote>
  
  <p>What am I doing wrong here? Thanks.</p>
  
  <pre><code>pub struct GMap&lt;T&gt; {
          priv     n: uint,
          priv darts: ~[Dart&lt;T&gt;]
      }
  
  struct Dart&lt;T&gt; {
      alpha: ~[@Dart&lt;T&gt;],
      embed: ~[@T],
     tagged: bool
  }
  
  impl&lt;T&gt; GMap&lt;T&gt; {
      pub fn new(dim: uint) -&gt; GMap&lt;T&gt; {      
          let mut map: GMap&lt;T&gt; = GMap{n: dim, darts: ~[]};
          return map
      }
      pub fn new_dart(&amp;self, ) -&gt; @Dart&lt;T&gt; {
          let mut dart = @Dart{alpha: ~[], embed: ~[], tagged: false};        
          dart.alpha = vec::from_elem(self.n + 1, dart); 
          //dart.embed = vec::from_elem(self.n + 1, );
          return dart;
      }
      pub fn dim(&amp;self) -&gt; uint {
          self.n 
      }
  }
  
  
  //pub fn traverse(&amp;self,[bool,..])
  
  
  enum Cell {
      Null,
      Vertex,
      Edge,
      Face,
      Solid
  }   
  
  fn main() { 
      let topo: GMap&lt;Cell&gt; = GMap::new(3);    
  }
  </code></pre>