remove unneeded .as_ref() calls.

This commit is contained in:
Matthias Krüger 2020-02-29 02:16:04 +01:00
parent 0eb878d2aa
commit f55b2c9b12
3 changed files with 3 additions and 3 deletions

View File

@ -657,7 +657,7 @@ impl EmbargoVisitor<'tcx> {
.map(|module_hir_id| self.tcx.hir().expect_item(module_hir_id))
{
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 def_id = self.tcx.hir().local_def_id(item_id.id);
if !self.tcx.hygienic_eq(segment.ident, item.ident, def_id) {

View File

@ -239,7 +239,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
.segments
.iter()
.filter_map(|seg| seg.args.as_ref())
.map(|generic_args| generic_args.args.as_ref())
.map(|generic_args| generic_args.args)
.find_map(|args| {
args.iter()
.filter(|arg| arg.is_const())

View File

@ -2011,7 +2011,7 @@ impl Path {
#[stable(feature = "rust1", since = "1.0.0")]
pub fn file_name(&self) -> Option<&OsStr> {
self.components().next_back().and_then(|p| match p {
Component::Normal(p) => Some(p.as_ref()),
Component::Normal(p) => Some(p),
_ => None,
})
}