pub fn from_token(t: ast::Token) -> Result<Self, ParseError> {
        match t.kind {
            K![!] => Ok(Self::Not),
            K![-] => Ok(Self::Neg),
            K![&] => Ok(Self::BorrowRef),
            K![*] => Ok(Self::Deref),
            _ => Err(ParseError::expected(&t, "unary operator, like `!` or `-`")),
        }
    }
/// Convert a unary operator from a token.
Convert a unary operator from a token.
Convert a unary operator from a token .
pub fn from_token(t: ast::Token) -> Result<Self, ParseError> {
        match t.kind {
            K![!] => Ok(Self::Not),
            K![-] => Ok(Self::Neg),
            K![&] => Ok(Self::BorrowRef),
            K![*] => Ok(Self::Deref),
            _ => Err(ParseError::expected(&t, "unary operator, like `!` or `-`")),
        }
    }
pub fn from_token ( t : ast :: Token ) -> Result < Self , ParseError > { match t . kind { K ! [ ] => Ok ( Self :: Not ) , K ! [ ] => Ok ( Self :: Neg ) , K ! [ ] => Ok ( Self :: BorrowRef ) , K ! [ ] => Ok ( Self :: Deref ) , _ => Err ( ParseError :: expected ( & t , " " ) ) , } }
Convert a unary operator from a token.
Convert a unary operator from a token .
t
ast::Token
t
ast::Token