SHARE
TWEET

Untitled

a guest Jul 21st, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pub enum Player {
  2.     White,
  3.     Black,
  4. }
  5.  
  6. pub enum Piece {
  7.     Pawn,
  8.     Bishop,
  9.     King,
  10.     Rook,
  11.     Queen,
  12.     Knight,
  13. }
  14.  
  15. pub type Square = Option<(Player, Piece)>;
  16.  
  17. pub fn main() {
  18.     println!("Player: {}", std::mem::size_of::<Player>());
  19.     println!("Piece: {}", std::mem::size_of::<Piece>());
  20.     println!("(Player, Piece): {}", std::mem::size_of::<(Player, Piece)>());
  21.     println!("Option<(Player, Piece)>: {}", std::mem::size_of::<Square>());
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top