fix file & rank parsing
This commit is contained in:
parent
a6a00fc819
commit
c71bbc216f
1 changed files with 4 additions and 4 deletions
|
|
@ -116,8 +116,8 @@ impl File {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_char(c: char) -> Option<Self> {
|
||||
Self::from_ascii(c as u8)
|
||||
pub fn from_char(file: char) -> Option<Self> {
|
||||
u8::try_from(file).ok().and_then(Self::from_ascii)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
@ -188,8 +188,8 @@ impl Rank {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_char(c: char) -> Option<Self> {
|
||||
Self::from_ascii(c as u8)
|
||||
pub fn from_char(rank: char) -> Option<Self> {
|
||||
u8::try_from(rank).ok().and_then(Self::from_ascii)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue