We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_empty()
first()
1 parent 77a4553 commit 0baa100Copy full SHA for 0baa100
compiler/rustc_hir/src/hir.rs
@@ -206,7 +206,7 @@ pub type UsePath<'hir> = Path<'hir, SmallVec<[Res; 3]>>;
206
207
impl Path<'_> {
208
pub fn is_global(&self) -> bool {
209
- !self.segments.is_empty() && self.segments[0].ident.name == kw::PathRoot
+ self.segments.first().is_some_and(|segment| segment.ident.name == kw::PathRoot)
210
}
211
212
0 commit comments