Function Not returning right value

Hello, I am working on a chess engine and have this method on the board struct

fn get_black_pawn_right_attacks(&self) -> u64{
   let out = (self.bp << 7) & self.aw;
   eprintln!("OUT: 0x{:016x}",out);
   return out;
}

I call it here inside another struct.

        eprintln!("right: 0x{:016}",self.board.get_black_pawn_right_attacks());

This causes

OUT: 0x0080000000000000
right: 0x36028797018963968

to be printed.
How are the 2 values different? What is happening?

You are missing the x at the end of the formatstring.

Thank you, I must be blind

just a reminder, you don't need the 0x prefix, you can use the alternate format for UpperHex and LowerHex, then the value will be formatted with a 0x prefiix.

these two give the exact same result:

   eprintln!("OUT: {:#018x}",out);
   eprintln!("OUT: 0x{:016x}",out);

be aware: the prefix in the alternate format is always in lower case 0x, even for the UpperHex formatter, which formats the hex digits in upper case; and the width specifier includes the 0x prefix too.