docs(rps/against-player): fix code snippets to match actual implementation#63
Merged
arihantbansal merged 1 commit intoarcium-hq:mainfrom Mar 8, 2026
Conversation
…ation Fixed variable names and a shadowing bug in player_move and compare_moves snippets where game.owner.from_arcis(game) wouldn't compile due to the original Enc being consumed by shadowing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
player_moveandcompare_movesREADME snippets to match actual codegame.owner.from_arcis(game)wouldn't compile (originalEncconsumed by shadowing)Issue
The README snippets used simplified variable names that differed from the actual implementation. More critically, the
player_movesnippet had a shadowing bug: afterlet mut game = game.to_arcis(), callinggame.ownerwould reference the decryptedGameMovesstruct (which has noownerfield), not the originalEnc<Mxe, GameMoves>.Changes
player_move:players_move→players_move_ctxt,game→game_ctxt(parameters)input→players_move,game→game_moves(local variables)game.owner.from_arcis(game)→game_ctxt.owner.from_arcis(game_moves)compare_moves:game→game_ctxt(parameter)moves→game_moves(local variable)Verification
Confirmed against actual code in
rock_paper_scissors/against-player/encrypted-ixs/src/lib.rs.Test plan