Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 4b190a1

Browse files
committed
Update doc comments for clippy
1 parent f23917a commit 4b190a1

File tree

13 files changed

+73
-58
lines changed

13 files changed

+73
-58
lines changed

governance/program/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![allow(clippy::arithmetic_side_effects)]
2+
#![allow(clippy::doc_lazy_continuation)]
23
#![deny(missing_docs)]
34
//! A Governance program for the Solana blockchain.
45

libraries/type-length-value/src/state.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ impl<'data> TlvStateMut<'data> {
375375

376376
/// Packs the default TLV data into the first open slot in the data buffer.
377377
/// Handles repetition based on the boolean arg provided:
378-
/// * `true`: If extension is already found in the buffer,
379-
/// it returns an error.
378+
/// * `true`: If extension is already found in the buffer, it returns an error.
380379
/// * `false`: Will add a new entry to the next open slot.
381380
pub fn init_value<V: SplDiscriminate + Pod + Default>(
382381
&mut self,

stake-pool/program/src/instruction.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,14 @@ pub enum StakePoolInstruction {
192192
/// 11. `[]` Stake Config sysvar
193193
/// 12. `[]` System program
194194
/// 13. `[]` Stake program
195-
/// userdata: amount of lamports to increase on the given validator.
196-
/// The actual amount split into the transient stake account is:
197-
/// `lamports + stake_rent_exemption`
198-
/// The rent-exemption of the stake account is withdrawn back to the
199-
/// reserve after it is merged.
195+
///
196+
/// userdata: amount of lamports to increase on the given validator.
197+
///
198+
/// The actual amount split into the transient stake account is:
199+
/// `lamports + stake_rent_exemption`.
200+
///
201+
/// The rent-exemption of the stake account is withdrawn back to the
202+
/// reserve after it is merged.
200203
IncreaseValidatorStake {
201204
/// amount of lamports to increase on the given validator
202205
lamports: u64,
@@ -329,6 +332,7 @@ pub enum StakePoolInstruction {
329332
/// 10. `[]` Sysvar clock account (required)
330333
/// 11. `[]` Pool token program id
331334
/// 12. `[]` Stake program id,
335+
///
332336
/// userdata: amount of pool tokens to withdraw
333337
WithdrawStake(u64),
334338

@@ -463,11 +467,14 @@ pub enum StakePoolInstruction {
463467
/// 11. `[]` Stake Config sysvar
464468
/// 12. `[]` System program
465469
/// 13. `[]` Stake program
466-
/// userdata: amount of lamports to increase on the given validator.
467-
/// The actual amount split into the transient stake account is:
468-
/// `lamports + stake_rent_exemption`
469-
/// The rent-exemption of the stake account is withdrawn back to the
470-
/// reserve after it is merged.
470+
///
471+
/// userdata: amount of lamports to increase on the given validator.
472+
///
473+
/// The actual amount split into the transient stake account is:
474+
/// `lamports + stake_rent_exemption`.
475+
///
476+
/// The rent-exemption of the stake account is withdrawn back to the
477+
/// reserve after it is merged.
471478
IncreaseAdditionalValidatorStake {
472479
/// amount of lamports to increase on the given validator
473480
lamports: u64,
@@ -674,6 +681,7 @@ pub enum StakePoolInstruction {
674681
/// 10. `[]` Sysvar clock account (required)
675682
/// 11. `[]` Pool token program id
676683
/// 12. `[]` Stake program id,
684+
///
677685
/// userdata: amount of pool tokens to withdraw
678686
WithdrawStakeWithSlippage {
679687
/// Pool tokens to burn in exchange for lamports

token-lending/program/src/instruction.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ pub enum LendingInstruction {
158158
///
159159
/// 0. `[writable]` Obligation account.
160160
/// 1. `[]` Clock sysvar.
161-
/// .. `[]` Collateral deposit reserve accounts - refreshed, all, in order.
162-
/// .. `[]` Liquidity borrow reserve accounts - refreshed, all, in order.
161+
/// 2. .. `[]` Collateral deposit reserve accounts - refreshed, all, in order.
162+
/// 3. .. `[]` Liquidity borrow reserve accounts - refreshed, all, in order.
163163
RefreshObligation,
164164

165165
// 8
@@ -302,8 +302,8 @@ pub enum LendingInstruction {
302302
/// 8. `[]` Flash loan receiver program id. Must implement an instruction
303303
/// that has tag of 0 and a signature of `(amount: u64)` This
304304
/// instruction must return the amount to the source liquidity account.
305-
/// .. `[any]` Additional accounts expected by the receiving program's
306-
/// `ReceiveFlashLoan` instruction.
305+
/// 9. .. `[any]` Additional accounts expected by the receiving program's
306+
/// `ReceiveFlashLoan` instruction.
307307
///
308308
/// The flash loan receiver program that is to be invoked should contain
309309
/// an instruction with tag `0` and accept the total amount (including
@@ -318,11 +318,11 @@ pub enum LendingInstruction {
318318
/// 1. `[writable]` Destination liquidity (matching the source from
319319
/// above).
320320
/// 2. `[]` Token program id
321-
/// .. `[any]` Additional accounts provided to the lending program's
322-
/// `FlashLoan` instruction above. ReceiveFlashLoan {
323-
/// // Amount that must be repaid by the receiver program
324-
/// amount: u64
325-
/// }
321+
/// 3. .. `[any]` Additional accounts provided to the lending program's
322+
/// `FlashLoan` instruction above. ReceiveFlashLoan {
323+
/// // Amount that must be repaid by the receiver program
324+
/// amount: u64
325+
/// }
326326
FlashLoan {
327327
/// The amount that is to be borrowed - u64::MAX for up to 100% of
328328
/// available liquidity

token-lending/program/tests/helpers/flash_loan_receiver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pub enum FlashLoanReceiverInstruction {
2323
/// 1. `[writable]` Destination liquidity (matching the source from
2424
/// above).
2525
/// 2. `[]` Token program id
26-
/// .. `[any]` Additional accounts provided to the lending program's
27-
/// `FlashLoan` instruction above.
26+
/// 3. ..`[any]` Additional accounts provided to the lending program's
27+
/// `FlashLoan` instruction above.
2828
ReceiveFlashLoan {
2929
/// The amount that is loaned
3030
amount: u64,

token-metadata/interface/src/instruction.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ pub enum TokenMetadataInstruction {
104104
/// By the end of the instruction, the metadata account must be properly
105105
/// resized based on the new size of the TLV entry.
106106
/// * If the new size is larger, the program must first reallocate to
107-
/// avoid
108-
/// overwriting other TLV entries.
107+
/// avoid overwriting other TLV entries.
109108
/// * If the new size is smaller, the program must reallocate at the end
110-
/// so that it's possible to iterate over TLV entries
109+
/// so that it's possible to iterate over TLV entries
111110
///
112111
/// Accounts expected by this instruction:
113112
///

token-swap/program/src/curve/offset.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ pub struct OffsetCurve {
3333
impl CurveCalculator for OffsetCurve {
3434
/// Constant product swap ensures token a * (token b + offset) = constant
3535
/// This is guaranteed to work for all values such that:
36+
///
3637
/// - 1 <= source_amount <= u64::MAX
3738
/// - 1 <= (swap_source_amount * (swap_destination_amount +
3839
/// token_b_offset)) <= u128::MAX
40+
///
3941
/// If the offset and token B are both close to u64::MAX, there can be
4042
/// overflow errors with the invariant.
4143
fn swap_without_fees(

token-swap/program/src/instruction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ pub enum SwapInstruction {
108108
/// 4. `[writable]` Pool Token Mint. Must be empty, owned by swap
109109
/// authority.
110110
/// 5. `[]` Pool Token Account to deposit trading and withdraw fees.
111-
/// Must be empty, not owned by swap authority
111+
/// Must be empty, not owned by swap authority
112112
/// 6. `[writable]` Pool Token Account to deposit the initial pool token
113-
/// supply. Must be empty, not owned by swap authority.
113+
/// supply. Must be empty, not owned by swap authority.
114114
/// 7. `[]` Pool Token program id
115115
Initialize(Initialize),
116116

token-wrap/program/src/instruction.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub enum TokenWrapInstruction {
4545
/// 6. `[]` SPL Token program for unwrapped mint
4646
/// 7. `[]` SPL Token program for wrapped mint
4747
/// 8. `[signer]` Transfer authority on unwrapped token account
48-
/// 8..8+M. `[signer]` (Optional) M multisig signers on unwrapped token
49-
/// account
48+
/// 9. ..8+M. `[signer]` (Optional) M multisig signers on unwrapped token
49+
/// account
5050
///
5151
/// Data expected by this instruction:
5252
/// * little-endian u64 representing the amount to wrap
@@ -72,8 +72,8 @@ pub enum TokenWrapInstruction {
7272
/// 6. `[]` SPL Token program for wrapped mint
7373
/// 7. `[]` SPL Token program for unwrapped mint
7474
/// 8. `[signer]` Transfer authority on wrapped token account
75-
/// 8..8+M. `[signer]` (Optional) M multisig signers on wrapped token
76-
/// account
75+
/// 9. ..8+M. `[signer]` (Optional) M multisig signers on wrapped token
76+
/// account
7777
///
7878
/// Data expected by this instruction:
7979
/// * little-endian u64 representing the amount to unwrap

token/program-2022/src/extension/confidential_transfer/instruction.rs

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ pub enum ConfidentialTransferInstruction {
102102
/// 3. `[]` (Optional) Record account if the accompanying proof is to be
103103
/// read from a record account.
104104
/// 4. `[]` The multisig source account owner.
105-
/// 5.. `[signer]` Required M signer accounts for the SPL Token Multisig
106-
/// account.
105+
/// 5. .. `[signer]` Required M signer accounts for the SPL Token Multisig
106+
/// account.
107107
///
108108
/// Data expected by this instruction:
109109
/// `ConfigureAccountInstructionData`
@@ -166,8 +166,8 @@ pub enum ConfidentialTransferInstruction {
166166
/// 2. `[]` (Optional) Record account if the accompanying proof is to be
167167
/// read from a record account.
168168
/// 3. `[]` The multisig account owner.
169-
/// 4.. `[signer]` Required M signer accounts for the SPL Token Multisig
170-
/// account.
169+
/// 4. .. `[signer]` Required M signer accounts for the SPL Token Multisig
170+
/// account.
171171
///
172172
/// Data expected by this instruction:
173173
/// `EmptyAccountInstructionData`
@@ -194,8 +194,8 @@ pub enum ConfidentialTransferInstruction {
194194
/// 0. `[writable]` The SPL Token account.
195195
/// 1. `[]` The token mint.
196196
/// 2. `[]` The multisig account owner or delegate.
197-
/// 3.. `[signer]` Required M signer accounts for the SPL Token Multisig
198-
/// account.
197+
/// 3. .. `[signer]` Required M signer accounts for the SPL Token Multisig
198+
/// account.
199199
///
200200
/// Data expected by this instruction:
201201
/// `DepositInstructionData`
@@ -207,8 +207,10 @@ pub enum ConfidentialTransferInstruction {
207207
/// In order for this instruction to be successfully processed, it must be
208208
/// accompanied by the following list of `zk_elgamal_proof` program
209209
/// instructions:
210+
///
210211
/// - `VerifyCiphertextCommitmentEquality`
211212
/// - `VerifyBatchedRangeProofU64`
213+
///
212214
/// These instructions can be accompanied in the same transaction or can be
213215
/// pre-verified into a context state account, in which case, only their
214216
/// context state account address need to be provided.
@@ -241,8 +243,8 @@ pub enum ConfidentialTransferInstruction {
241243
/// 4. `[]` (Optional) Range proof record account or context state
242244
/// account.
243245
/// 5. `[]` The multisig source account owner.
244-
/// 6.. `[signer]` Required M signer accounts for the SPL Token Multisig
245-
/// account.
246+
/// 6. .. `[signer]` Required M signer accounts for the SPL Token Multisig
247+
/// account.
246248
///
247249
/// Data expected by this instruction:
248250
/// `WithdrawInstructionData`
@@ -253,9 +255,11 @@ pub enum ConfidentialTransferInstruction {
253255
/// In order for this instruction to be successfully processed, it must be
254256
/// accompanied by the following list of `zk_elgamal_proof` program
255257
/// instructions:
258+
///
256259
/// - `VerifyCiphertextCommitmentEquality`
257260
/// - `VerifyBatchedGroupedCiphertext3HandlesValidity`
258261
/// - `VerifyBatchedRangeProofU128`
262+
///
259263
/// These instructions can be accompanied in the same transaction or can be
260264
/// pre-verified into a context state account, in which case, only their
261265
/// context state account addresses need to be provided.
@@ -291,8 +295,8 @@ pub enum ConfidentialTransferInstruction {
291295
/// 7. `[]` (Optional) Range proof record account or context state
292296
/// account.
293297
/// 8. `[]` The multisig source account owner.
294-
/// 9.. `[signer]` Required M signer accounts for the SPL Token Multisig
295-
/// account.
298+
/// 9. .. `[signer]` Required M signer accounts for the SPL Token Multisig
299+
/// account.
296300
///
297301
/// Data expected by this instruction:
298302
/// `TransferInstructionData`
@@ -319,8 +323,8 @@ pub enum ConfidentialTransferInstruction {
319323
/// * Multisignature owner/delegate
320324
/// 0. `[writable]` The SPL Token account.
321325
/// 1. `[]` The multisig account owner.
322-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig
323-
/// account.
326+
/// 2. .. `[signer]` Required M signer accounts for the SPL Token Multisig
327+
/// account.
324328
///
325329
/// Data expected by this instruction:
326330
/// `ApplyPendingBalanceData`
@@ -338,8 +342,8 @@ pub enum ConfidentialTransferInstruction {
338342
/// * Multisignature owner/delegate
339343
/// 0. `[writable]` The SPL Token account.
340344
/// 1. `[]` Multisig authority.
341-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig
342-
/// account.
345+
/// 2. .. `[signer]` Required M signer accounts for the SPL Token Multisig
346+
/// account.
343347
///
344348
/// Data expected by this instruction:
345349
/// None
@@ -363,8 +367,8 @@ pub enum ConfidentialTransferInstruction {
363367
/// * Multisignature owner/delegate
364368
/// 0. `[writable]` The SPL Token account.
365369
/// 1. `[]` The multisig account owner.
366-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig
367-
/// account.
370+
/// 2. .. `[signer]` Required M signer accounts for the SPL Token Multisig
371+
/// account.
368372
///
369373
/// Data expected by this instruction:
370374
/// None
@@ -382,8 +386,8 @@ pub enum ConfidentialTransferInstruction {
382386
/// * Multisignature owner/delegate
383387
/// 0. `[writable]` The SPL Token account.
384388
/// 1. `[]` The multisig account owner.
385-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig
386-
/// account.
389+
/// 2. .. `[signer]` Required M signer accounts for the SPL Token Multisig
390+
/// account.
387391
///
388392
/// Data expected by this instruction:
389393
/// None
@@ -404,8 +408,8 @@ pub enum ConfidentialTransferInstruction {
404408
/// * Multisignature owner/delegate
405409
/// 0. `[writable]` The SPL Token account.
406410
/// 1. `[]` The multisig account owner.
407-
/// 2.. `[signer]` Required M signer accounts for the SPL Token Multisig
408-
/// account.
411+
/// 2. .. `[signer]` Required M signer accounts for the SPL Token Multisig
412+
/// account.
409413
///
410414
/// Data expected by this instruction:
411415
/// None
@@ -416,12 +420,14 @@ pub enum ConfidentialTransferInstruction {
416420
/// In order for this instruction to be successfully processed, it must be
417421
/// accompanied by the following list of `zk_elgamal_proof` program
418422
/// instructions:
423+
///
419424
/// - `VerifyCiphertextCommitmentEquality`
420425
/// - `VerifyBatchedGroupedCiphertext3HandlesValidity` (transfer amount
421426
/// ciphertext)
422427
/// - `VerifyPercentageWithFee`
423428
/// - `VerifyBatchedGroupedCiphertext2HandlesValidity` (fee ciphertext)
424429
/// - `VerifyBatchedRangeProofU256`
430+
///
425431
/// These instructions can be accompanied in the same transaction or can be
426432
/// pre-verified into a context state account, in which case, only their
427433
/// context state account addresses need to be provided.
@@ -467,7 +473,7 @@ pub enum ConfidentialTransferInstruction {
467473
/// 9. `[]` (Optional) Range proof record account or context state
468474
/// account.
469475
/// 10. `[]` The multisig source account owner.
470-
/// 11.. `[signer]` Required M signer accounts for the SPL Token Multisig
476+
/// 11. .. `[signer]` Required M signer accounts for the SPL Token Multisig
471477
///
472478
/// Data expected by this instruction:
473479
/// `TransferWithFeeInstructionData`

0 commit comments

Comments
 (0)