You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust offers us this convenient feature of setting any type that implements Default to its default using Default::default(). Unfortunately it makes the code unreadable.
Proposed Solution
Replace most of the 72 instances in current code with an explicit type. For example, if the function accepts a Pubkey, replace Default::default() with Pubkey::default().
The text was updated successfully, but these errors were encountered:
- Removes the empty program account check (InvalidAccountData).
- Adjusts checks of program.state.status to conform to error messages.
- Adds check to prevent authority transfer to itself.
- Adjusts most execution errors to UnsupportedProgramId.
- Removes the redundant owner check in execution.
- Adds a tombstone in the program cache upon retraction.
Problem
Rust offers us this convenient feature of setting any type that implements
Default
to its default usingDefault::default()
. Unfortunately it makes the code unreadable.Proposed Solution
Replace most of the 72 instances in current code with an explicit type. For example, if the function accepts a
Pubkey
, replaceDefault::default()
withPubkey::default()
.The text was updated successfully, but these errors were encountered: