fn duplicate_sapling_spend_in_shielded_data<A: sapling::AnchorVariant + Clone>(
    shielded_data: &mut sapling::ShieldedData<A>,
) -> sapling::Nullifier {
    match shielded_data.transfers {
        sapling::TransferData::SpendsAndMaybeOutputs { ref mut spends, .. } => {
            let duplicate_spend = spends.first().clone();
            let duplicate_nullifier = duplicate_spend.nullifier;

            spends.push(duplicate_spend);

            duplicate_nullifier
        }
        sapling::TransferData::JustOutputs { .. } => {
            unreachable!("Sapling shielded data has no spends")
        }
    }
}
/// Duplicates the first spend of the `shielded_data`.
///
/// Returns the nullifier of the duplicate spend.
///
/// # Panics
///
/// Will panic if `shielded_data` has no spends.
Duplicates the first spend of the `shielded_data`.
Returns the nullifier of the duplicate spend.
Duplicates the first spend of the ` shielded_data ` . Returns the nullifier of the duplicate spend .
fn duplicate_sapling_spend_in_shielded_data<A: sapling::AnchorVariant + Clone>(
    shielded_data: &mut sapling::ShieldedData<A>,
) -> sapling::Nullifier {
    match shielded_data.transfers {
        sapling::TransferData::SpendsAndMaybeOutputs { ref mut spends, .. } => {
            let duplicate_spend = spends.first().clone();
            let duplicate_nullifier = duplicate_spend.nullifier;
            spends.push(duplicate_spend);
            duplicate_nullifier
        }
        sapling::TransferData::JustOutputs { .. } => {
            unreachable!("Sapling shielded data has no spends")
        }
    }
}
fn duplicate_sapling_spend_in_shielded_data < A : sapling :: AnchorVariant + Clone > ( shielded_data : & mut sapling :: ShieldedData < A > , ) -> sapling :: Nullifier { match shielded_data . transfers { sapling :: TransferData :: SpendsAndMaybeOutputs { ref mut spends , .. } => { let duplicate_spend = spends . first ( ) . clone ( ) ; let duplicate_nullifier = duplicate_spend . nullifier ; spends . push ( duplicate_spend ) ; duplicate_nullifier } sapling :: TransferData :: JustOutputs { .. } => { unreachable ! ( " " ) } } }
Duplicates the first spend of the `shielded_data`.
Duplicates the first spend of the ` shielded_data ` .
shielded_data
&mut sapling::ShieldedData<A>
panics
Will panic if `shielded_data` has no spends.
Will panic if ` shielded_data ` has no spends .