1
0
Fork 0

fix ascii methods

This commit is contained in:
Paul-Nicolas Madelaine 2025-10-19 15:20:01 +02:00
parent 89e6a95ded
commit 0e65b4f927

View file

@ -128,7 +128,7 @@ impl File {
#[inline] #[inline]
pub fn from_char(file: char) -> Option<Self> { pub fn from_char(file: char) -> Option<Self> {
Self::from_ascii(file as u8) Some(Self::from_ascii(u8::try_from(file).ok()?)?)
} }
#[inline] #[inline]
@ -208,7 +208,7 @@ impl Rank {
#[inline] #[inline]
pub fn from_char(rank: char) -> Option<Self> { pub fn from_char(rank: char) -> Option<Self> {
Self::from_ascii(rank as u8) Some(Self::from_ascii(u8::try_from(rank).ok()?)?)
} }
#[inline] #[inline]