Skip to content

Commit 8214788

Browse files
authored
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]`.
2 parents d544e21 + 66a02ec commit 8214788

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_privacy/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ impl EmbargoVisitor<'tcx> {
637637
&mut self,
638638
segments: &[hir::PathSegment<'_>],
639639
) {
640-
if let Some([module, segment]) = segments.rchunks_exact(2).next() {
640+
if let [.., module, segment] = segments {
641641
if let Some(item) = module
642642
.res
643643
.and_then(|res| res.mod_def_id())

0 commit comments

Comments
 (0)