Use a slice pattern instead of rchunks_exact(_).next()
This is a minor cleanup, but trying a single-use `rchunks` iterator can be more directly matched with a slice pattern, `[.., a, b]`.
This commit is contained in:
parent
cfdf9d3355
commit
66a02ec2d6
1 changed files with 1 additions and 1 deletions
|
@ -637,7 +637,7 @@ impl EmbargoVisitor<'tcx> {
|
||||||
&mut self,
|
&mut self,
|
||||||
segments: &[hir::PathSegment<'_>],
|
segments: &[hir::PathSegment<'_>],
|
||||||
) {
|
) {
|
||||||
if let Some([module, segment]) = segments.rchunks_exact(2).next() {
|
if let [.., module, segment] = segments {
|
||||||
if let Some(item) = module
|
if let Some(item) = module
|
||||||
.res
|
.res
|
||||||
.and_then(|res| res.mod_def_id())
|
.and_then(|res| res.mod_def_id())
|
||||||
|
|
Loading…
Reference in a new issue