fn to_string(&self) -> String {
        let state = self.state.lock().unwrap();
        let mut s = String::from("===Ponies===\n");
        if state.slaves.is_empty() {
            s += "You have no ponies in your farm right now :(\n";
        } else {
            for slave in state.slaves.iter() {
                s += &slave.to_string();
                s += "\n";
            }
        }
        s += "\n";
        if !state.graveyard.is_empty() {
            s += "These ponies used to work with you, but have moved on to greener pastures:\n";
            for body in state.graveyard.iter() {
                s += &format!(" - {}\n", body.name);
            }
            s += "\n";
        }
        s += "===Items===\n";
        s += &format!("Money: ${}", state.money);
        s
    }
// this is what shows up when you press S
this is what shows up when you press S
this is what shows up when you press S
fn to_string(&self) -> String {
        let state = self.state.lock().unwrap();
        let mut s = String::from("===Ponies===\n");
        if state.slaves.is_empty() {
            s += "You have no ponies in your farm right now :(\n";
        } else {
            for slave in state.slaves.iter() {
                s += &slave.to_string();
                s += "\n";
            }
        }
        s += "\n";
        if !state.graveyard.is_empty() {
            s += "These ponies used to work with you, but have moved on to greener pastures:\n";
            for body in state.graveyard.iter() {
                s += &format!(" - {}\n", body.name);
            }
            s += "\n";
        }
        s += "===Items===\n";
        s += &format!("Money: ${}", state.money);
        s
    }
fn to_string ( & self ) -> String { let state = self . state . lock ( ) . unwrap ( ) ; let mut s = String :: from ( " \n " ) ; if state . slaves . is_empty ( ) { s += " \n " ; } else { for slave in state . slaves . iter ( ) { s += & slave . to_string ( ) ; s += " \n " ; } } s += " \n " ; if ! state . graveyard . is_empty ( ) { s += " \n " ; for body in state . graveyard . iter ( ) { s += & format ! ( " \n " body name ) ; } s += " \n " ; } s += " \n " ; s += & format ! ( " " state money ) ; s }
this is what shows up when you press S
this is what shows up when you press S
&self
&self