Skip to content

Commit 66a02ec

Browse files
committed
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]`.
1 parent cfdf9d3 commit 66a02ec

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)