Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crytic/solana-lints
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f5c873d8efa800471b39dae3ceb19d0b8a7a7f98
Choose a base ref
..
head repository: crytic/solana-lints
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d96b13a8f347887a4dd94dbd5d3236ff5b0c023f
Choose a head ref
Showing with 3 additions and 3 deletions.
  1. +3 −3 lints/insecure_account_close/src/lib.rs
6 changes: 3 additions & 3 deletions lints/insecure_account_close/src/lib.rs
Original file line number Diff line number Diff line change
@@ -86,9 +86,9 @@ fn is_initial_eight_byte_copy_from_slice(expr: &Expr<'_>) -> bool {
if let ExprKind::Struct(qpath, fields, None) = index.kind;
if matches!(qpath, QPath::LangItem(LangItem::Range, _));
if let [start, end] = fields;
if let ExprKind::Lit(ref start_lit) = start.expr.kind;
if let ExprKind::Lit(start_lit) = start.expr.kind;
if let LitKind::Int(0, LitIntType::Unsuffixed) = start_lit.node;
if let ExprKind::Lit(ref end_lit) = end.expr.kind;
if let ExprKind::Lit(end_lit) = end.expr.kind;
if let LitKind::Int(8, LitIntType::Unsuffixed) = end_lit.node;
then {
true
@@ -159,7 +159,7 @@ fn contains_zero_assignment<'tcx>(expr: &'tcx Expr<'tcx>) -> bool {
fn is_zero_assignment<'tcx>(expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> {
if_chain! {
if let ExprKind::Assign(place, value, _) = expr.kind;
if let ExprKind::Lit(ref lit) = value.kind;
if let ExprKind::Lit(lit) = value.kind;
if let LitKind::Int(0, LitIntType::Unsuffixed) = lit.node;
then {
Some(place)