mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
fmt fixes
This commit is contained in:
parent
f3363b9cf2
commit
68096cf181
3 changed files with 8 additions and 7 deletions
|
@ -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) {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue