diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-02-26 19:43:29 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-02-26 19:43:29 +0300 |
commit | 280fbc2acedcc5bbfcca141e610b3b37cf7d4397 (patch) | |
tree | f34c22268036545f350682fc1c591f59ed76279f /src/square.rs | |
parent | 3ae684ec1f697f2e34eec755bfeffb20a3a1d856 (diff) | |
download | chessnost-280fbc2acedcc5bbfcca141e610b3b37cf7d4397.tar.gz |
feat: implement notation Display for moves
Diffstat (limited to 'src/square.rs')
-rw-r--r-- | src/square.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/square.rs b/src/square.rs index 8a268ea..c7f185e 100644 --- a/src/square.rs +++ b/src/square.rs @@ -1,4 +1,4 @@ -use std::str::Chars; +use std::{str::Chars, fmt::Display}; use crate::bitboard::Bitboard; @@ -91,4 +91,11 @@ impl Square { } } +impl Display for Square { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let notation = format!("{:?}", self).to_lowercase(); + write!(f, "{}", notation) + } +} + |