Skip to content

Prevent using GetMe with input#36

Merged
orsinium merged 2 commits intomainfrom
type-safe-me
Feb 28, 2026
Merged

Prevent using GetMe with input#36
orsinium merged 2 commits intomainfrom
type-safe-me

Conversation

@orsinium
Copy link
Copy Markdown
Member

  1. Make GetMe return a new Me type instead of Peer.
  2. This type can be used only with GetSettings or for equality comparison with Peer.

While you can, if you really want, convert Me to Peer by iterating over Peers and picking the one that equals to Me, it would require deliberately going out of your way to shoot yourself in the foot. So, the change should prevent the most common pitfalls, like ReadPad(GetMe()).

See firefly-zero/firefly-runtime#9.

@orsinium orsinium merged commit 8e23075 into main Feb 28, 2026
1 check passed
@orsinium orsinium deleted the type-safe-me branch February 28, 2026 20:13
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.

1 participant