Skip to content

Commit 27edd7f

Browse files
committed
minor IR updates
1 parent 1f5547c commit 27edd7f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

crates/ir/src/attrs/meta/value.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ impl MetaValue {
161161
value
162162
})
163163
}
164+
165+
/// Converts the value if it's a path expression into a `Path` with an inaccurate text range.
166+
pub fn as_path_with_inaccurate_text_range(&self) -> Option<ast::Path> {
167+
match &self.expr {
168+
ast::Expr::PathExpr(path) => path.path(),
169+
_ => None,
170+
}
171+
}
164172
}
165173

166174
impl fmt::Display for MetaValue {

crates/ir/src/selector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub struct SelectorArg {
136136
}
137137

138138
impl SelectorArg {
139-
/// Returns true if the syntax node can be converted into an ink! impl item.
139+
/// Returns true if the ink! argument can be converted into an ink! selector.
140140
pub fn can_cast(arg: &InkArg) -> bool {
141141
*arg.kind() == InkArgKind::Selector
142142
}

0 commit comments

Comments
 (0)