summaryrefslogblamecommitdiff
path: root/meap/meap-code/ch4/ch4-check-sats-clone-and-copy-traits.rs
blob: df17ed534604c5deccfa1754c6f953f3e608f1fd (plain) (tree)























                                                    
#[derive(Debug,Copy)]
struct CubeSat {
  id: u64,
}

#[derive(Debug,Copy)]
enum StatusMessage {
  Ok,
}


fn check_status(sat_id: CubeSat) -> StatusMessage {
  StatusMessage::Ok
}

fn main () {
  let sat_a = CubeSat { id: 0 };

  let a_status = check_status(sat_a.clone());
  println!("a: {:?}", a_status.clone();

  let a_status = check_status(sat_a);
  println!("a: {:?}", a_status);
}