pub fn change_password(&mut self, new_password: String, current_password: &str) -> bool {
        if self.password == current_password {
            self.password = new_password;
            true
        } else {
            false
        }
    }
/// Changes user password from current to new if current is the same as 'self.password'.
Changes user password from current to new if current is the same as 'self.password'.
Changes user password from current to new if current is the same as ' self . password ' .
pub fn change_password(&mut self, new_password: String, current_password: &str) -> bool {
        if self.password == current_password {
            self.password = new_password;
            true
        } else {
            false
        }
    }
pub fn change_password ( & mut self , new_password : String , current_password : & str ) -> bool { if self . password == current_password { self . password = new_password ; true } else { false } }
Changes user password from current to new if current is the same as 'self.password'.
Changes user password from current to new if current is the same as ' self . password ' .
&mut self
new_password
String
current_password
&str