rustc_hir: replace is_empty()
+indexing with first()
This commit is contained in:
parent
77a455303b
commit
0baa100710
1 changed files with 1 additions and 1 deletions
|
@ -206,7 +206,7 @@ pub type UsePath<'hir> = Path<'hir, SmallVec<[Res; 3]>>;
|
|||
|
||||
impl Path<'_> {
|
||||
pub fn is_global(&self) -> bool {
|
||||
!self.segments.is_empty() && self.segments[0].ident.name == kw::PathRoot
|
||||
self.segments.first().is_some_and(|segment| segment.ident.name == kw::PathRoot)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue