mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Use Symbol in Name
This commit is contained in:
parent
843806b79f
commit
3fe815b0f3
75 changed files with 750 additions and 755 deletions
|
@ -9,6 +9,7 @@ use hir_expand::{
|
|||
attrs::{collect_attrs, Attr, AttrId, RawAttrs},
|
||||
HirFileId, InFile,
|
||||
};
|
||||
use intern::sym;
|
||||
use la_arena::{ArenaMap, Idx, RawIdx};
|
||||
use mbe::DelimiterKind;
|
||||
use syntax::{
|
||||
|
@ -199,8 +200,8 @@ impl Attrs {
|
|||
.segments()
|
||||
.iter()
|
||||
.rev()
|
||||
.zip(["core", "prelude", "v1", "test"].iter().rev())
|
||||
.all(|it| it.0.as_str() == Some(it.1))
|
||||
.zip([sym::core, sym::prelude, sym::v1, sym::test].iter().rev())
|
||||
.all(|it| it.0 == it.1)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -568,6 +569,10 @@ impl<'attr> AttrQuery<'attr> {
|
|||
self.attrs().find_map(|attr| attr.string_value())
|
||||
}
|
||||
|
||||
pub fn string_value_with_span(self) -> Option<(&'attr str, span::Span)> {
|
||||
self.attrs().find_map(|attr| attr.string_value_with_span())
|
||||
}
|
||||
|
||||
pub fn string_value_unescape(self) -> Option<Cow<'attr, str>> {
|
||||
self.attrs().find_map(|attr| attr.string_value_unescape())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue