title: Is this the Correct way to make mutable variable immutable again in rust?
body: <p>I've created a simple list that has mutable push behaviour but no need to have that same mutability for peek fn</p>
  <pre><code>fn peek(){
          let  mut list = List::new();//take a mutable ref here to perform push
          list.push(1);
          let list = list; //shadow the variable with the same name and take a immut ref
          
          assert_eq!(list.peek().unwrap(),&amp;1);
  
      }
  </code></pre>