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:
Josh Stone 2020-08-01 11:41:59 -07:00
parent cfdf9d3355
commit 66a02ec2d6

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())