fmt fixes

This commit is contained in:
Philipp Hansch 2019-03-03 13:00:49 +01:00
parent f3363b9cf2
commit 68096cf181
No known key found for this signature in database
GPG key ID: B6FA06A6E0E2665B
3 changed files with 8 additions and 7 deletions

View file

@ -112,9 +112,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
let map = &self.cx.tcx.hir();
if map.is_argument(map.hir_to_node_id(consume_pat.hir_id)) {
// Skip closure arguments
if let Some(Node::Expr(..)) = map.find_by_hir_id(
map.get_parent_node_by_hir_id(consume_pat.hir_id))
{
if let Some(Node::Expr(..)) = map.find_by_hir_id(map.get_parent_node_by_hir_id(consume_pat.hir_id)) {
return;
}
if is_non_trait_box(cmt.ty) && !self.is_large_box(cmt.ty) {

View file

@ -194,7 +194,10 @@ fn check_impl_items(cx: &LateContext<'_, '_>, item: &Item, impl_items: &[ImplIte
}
let is_empty = if let Some(is_empty) = impl_items.iter().find(|i| is_named_self(cx, i, "is_empty")) {
if cx.access_levels.is_exported(cx.tcx.hir().hir_to_node_id(is_empty.id.hir_id)) {
if cx
.access_levels
.is_exported(cx.tcx.hir().hir_to_node_id(is_empty.id.hir_id))
{
return;
} else {
"a private"

View file

@ -2051,9 +2051,9 @@ enum VarState {
/// Scan a for loop for variables that are incremented exactly once.
struct IncrementVisitor<'a, 'tcx: 'a> {
cx: &'a LateContext<'a, 'tcx>, // context reference
states: FxHashMap<HirId, VarState>, // incremented variables
depth: u32, // depth of conditional expressions
cx: &'a LateContext<'a, 'tcx>, // context reference
states: FxHashMap<HirId, VarState>, // incremented variables
depth: u32, // depth of conditional expressions
done: bool,
}