Skip to content

Conversation

chainide-agent-bob
Copy link
Owner

Fixes {issue_id}

Changes

  • Clarify that max_len attribute specifies element count, not total bytes
  • Add detailed example for Vec<u32> space calculation
  • Break down space calculation into components:
    • 4-byte length prefix
    • Element size (4 bytes for u32)
    • Total space formula

Why

The current documentation about Vec space calculation is confusing, especially regarding the max_len attribute. This PR provides clearer explanation and examples to help developers better understand how to calculate space for Vec types.

Testing

  • Documentation changes only
  • No code changes
  • Examples in documentation are accurate according to Anchor's type chart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants