internal: make naming consistent

This commit is contained in:
Aleksey Kladov 2021-08-14 17:01:28 +03:00
parent faa420fc32
commit 6df00f8495
9 changed files with 14 additions and 14 deletions

View file

@ -24,7 +24,7 @@ pub use self::{
AttrKind, AttrsOwnerNode, FieldKind, Macro, NameLike, NameOrNameRef, PathSegmentKind,
SelfParamKind, SlicePatComponents, StructKind, TypeBoundKind, VisibilityKind,
},
operators::{PrefixOp, RangeOp},
operators::{RangeOp, UnaryOp},
token_ext::{
CommentKind, CommentPlacement, CommentShape, HasFormatSpecifier, IsString, QuoteOffsets,
Radix,

View file

@ -5,7 +5,7 @@ use rowan::WalkEvent;
use crate::{
ast::{
self,
operators::{PrefixOp, RangeOp},
operators::{RangeOp, UnaryOp},
support, AstChildren, AstNode,
},
AstToken,
@ -198,11 +198,11 @@ impl ast::IfExpr {
}
impl ast::PrefixExpr {
pub fn op_kind(&self) -> Option<PrefixOp> {
pub fn op_kind(&self) -> Option<UnaryOp> {
let res = match self.op_token()?.kind() {
T![*] => PrefixOp::Deref,
T![!] => PrefixOp::Not,
T![-] => PrefixOp::Neg,
T![*] => UnaryOp::Deref,
T![!] => UnaryOp::Not,
T![-] => UnaryOp::Neg,
_ => return None,
};
Some(res)

View file

@ -1,5 +1,5 @@
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum PrefixOp {
pub enum UnaryOp {
/// The `*` operator for dereferencing
Deref,
/// The `!` operator for logical inversion