remove unneeded .as_ref() calls.
This commit is contained in:
parent
0eb878d2aa
commit
f55b2c9b12
3 changed files with 3 additions and 3 deletions
|
@ -657,7 +657,7 @@ impl EmbargoVisitor<'tcx> {
|
||||||
.map(|module_hir_id| self.tcx.hir().expect_item(module_hir_id))
|
.map(|module_hir_id| self.tcx.hir().expect_item(module_hir_id))
|
||||||
{
|
{
|
||||||
if let hir::ItemKind::Mod(m) = &item.kind {
|
if let hir::ItemKind::Mod(m) = &item.kind {
|
||||||
for item_id in m.item_ids.as_ref() {
|
for item_id in m.item_ids {
|
||||||
let item = self.tcx.hir().expect_item(item_id.id);
|
let item = self.tcx.hir().expect_item(item_id.id);
|
||||||
let def_id = self.tcx.hir().local_def_id(item_id.id);
|
let def_id = self.tcx.hir().local_def_id(item_id.id);
|
||||||
if !self.tcx.hygienic_eq(segment.ident, item.ident, def_id) {
|
if !self.tcx.hygienic_eq(segment.ident, item.ident, def_id) {
|
||||||
|
|
|
@ -239,7 +239,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
|
||||||
.segments
|
.segments
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|seg| seg.args.as_ref())
|
.filter_map(|seg| seg.args.as_ref())
|
||||||
.map(|generic_args| generic_args.args.as_ref())
|
.map(|generic_args| generic_args.args)
|
||||||
.find_map(|args| {
|
.find_map(|args| {
|
||||||
args.iter()
|
args.iter()
|
||||||
.filter(|arg| arg.is_const())
|
.filter(|arg| arg.is_const())
|
||||||
|
|
|
@ -2011,7 +2011,7 @@ impl Path {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub fn file_name(&self) -> Option<&OsStr> {
|
pub fn file_name(&self) -> Option<&OsStr> {
|
||||||
self.components().next_back().and_then(|p| match p {
|
self.components().next_back().and_then(|p| match p {
|
||||||
Component::Normal(p) => Some(p.as_ref()),
|
Component::Normal(p) => Some(p),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue