Rollup merge of #75022 - cuviper:sliced-rchunk, r=lcnr

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:
Manish Goregaokar 2020-08-01 17:42:18 -07:00 committed by GitHub
commit 82147885bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -637,7 +637,7 @@ impl EmbargoVisitor<'tcx> {
&mut self,
segments: &[hir::PathSegment<'_>],
) {
if let Some([module, segment]) = segments.rchunks_exact(2).next() {
if let [.., module, segment] = segments {
if let Some(item) = module
.res
.and_then(|res| res.mod_def_id())