mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-09 21:42:44 +00:00
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
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user