mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-18 17:40:29 +00:00
internal: make naming consistent
This commit is contained in:
parent
faa420fc32
commit
6df00f8495
9 changed files with 14 additions and 14 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue