fn from_str(s: &str) -> Result<UciPiece, FmtError> {
        match s.to_ascii_lowercase().as_str() {
            "n" => Ok(UciPiece::Knight),
            "p" => Ok(UciPiece::Pawn),
            "b" => Ok(UciPiece::Bishop),
            "r" => Ok(UciPiece::Rook),
            "k" => Ok(UciPiece::King),
            "q" => Ok(UciPiece::Queen),
            _ => Err(FmtError)
        }
    }
/// Creates a `UciPiece` from a `&str`, according to these rules:
///
/// `"n"` - Knight
/// `"p"` - Pawn
/// `"b"` - Bishop
/// `"r"` - Rook
/// `"k"` - King
/// `"q"` - Queen
///
/// Works with uppercase letters as well.


Works with uppercase letters as well.
Works with uppercase letters as well .
fn from_str(s: &str) -> Result<UciPiece, FmtError> {
        match s.to_ascii_lowercase().as_str() {
            "n" => Ok(UciPiece::Knight),
            "p" => Ok(UciPiece::Pawn),
            "b" => Ok(UciPiece::Bishop),
            "r" => Ok(UciPiece::Rook),
            "k" => Ok(UciPiece::King),
            "q" => Ok(UciPiece::Queen),
            _ => Err(FmtError)
        }
    }
fn from_str ( s : & str ) -> Result < UciPiece , FmtError > { match s . to_ascii_lowercase ( ) . as_str ( ) { " " => Ok ( UciPiece :: Knight ) , " " => Ok ( UciPiece :: Pawn ) , " " => Ok ( UciPiece :: Bishop ) , " " => Ok ( UciPiece :: Rook ) , " " => Ok ( UciPiece :: King ) , " " => Ok ( UciPiece :: Queen ) , _ => Err ( FmtError ) } }
Creates a `UciPiece` from a `&str`, according to these rules:
`"n"` - Knight
`"p"` - Pawn
`"b"` - Bishop
`"r"` - Rook
`"k"` - King
`"q"` - Queen
Creates a ` UciPiece ` from a ` &str ` according to these rules : ` " n " ` - Knight ` " p " ` - Pawn ` " b " ` - Bishop ` " r " ` - Rook ` " k " ` - King ` " q " ` - Queen
s
&str