title: refcell rc<refcell<>> doesn't change
body: <p>Here is my simplified code. I need to change the pdp_state in a function. but the state remain 'a'. I don't figure out why cloning Rc does not work. I also checked this cloning out side a structure an it worked.</p>
  <pre><code>#[derive(Clone,Copy)]
  enum PDPStatus{
      a,
      b
  }
  struct network{
      pdp_state:Rc&lt;RefCell&lt;PDPStatus&gt;&gt;,
  }
  impl network{
      fn set(&amp;mut self){
          let mut t = *self.pdp_state.clone().borrow_mut();
          match t {
              a =&gt; {let m1 = self.pdp_state.clone();
                  let mut a = (*m1).borrow_mut() ;
                  *a = PDPStatus::b;
                  println!(&quot;a&quot;);},
              b=&gt; {let m1 = self.pdp_state.clone();m1.replace( PDPStatus::a);
                  println!(&quot;b&quot;);},
          };
  
      }
  }
  fn main() {
      let mut network1 = network::new();
      network1.set();
      network1.set();
      network1.set();
      network1.set();
  }
  </code></pre>
  <p>Update:
  My set function would look like this. I need two closure that have access to pdp_state. I pass these closures as callbacks. I am sure the these closure wouldn't call together.</p>
  <pre><code>    fn set(&amp;mut self){
          let borrowed_pdp_status = self.pdp_state.borrow().clone();
          match borrowed_pdp_status {
              PDPStatus::a =&gt; {
                  let mut state = self.pdp_state.clone();
                  let mut closuree = || state =  Rc::new(RefCell::new(PDPStatus::b));
                  let mut state1 = self.pdp_state.clone();
                  let mut closuree1 = || state1 = Rc::new(RefCell::new(PDPStatus::b));
  
                  closuree();
                  closuree1();
                  println!(&quot;a&quot;);
              },
              PDPStatus::b =&gt; {
                  let mut closuree = || self.pdp_state = Rc::new(RefCell::new(PDPStatus::a));
                  closuree();
                  println!(&quot;b&quot;);
              },
          };
      }
  </code></pre>