all: remove unneeded deref and/or ref operations

This commit is contained in:
Georg Brandl
2015-08-25 14:41:35 +02:00
committed by llogiq
parent 88047a0953
commit b13d318f48
16 changed files with 33 additions and 37 deletions

View File

@@ -1,7 +1,6 @@
use rustc::lint::*;
use syntax::ast::*;
use syntax::codemap::{ExpnInfo, Span};
use syntax::ptr::P;
use rustc::ast_map::Node::NodeExpr;
use rustc::middle::ty;
use std::borrow::Cow;
@@ -130,9 +129,6 @@ pub fn get_parent_expr<'c>(cx: &'c Context, e: &Expr) -> Option<&'c Expr> {
if let NodeExpr(parent) = node { Some(parent) } else { None } )
}
/// dereference a P<T> and return a ref on the result
pub fn de_p<T>(p: &P<T>) -> &T { &*p }
#[cfg(not(feature="structured_logging"))]
pub fn span_lint(cx: &Context, lint: &'static Lint, sp: Span, msg: &str) {
cx.span_lint(lint, sp, msg);