{"action":"created","comment":{"url":"https://api.github.com/repos/nathanbw/game-of-life/pulls/comments/66324043","id":66324043,"diff_hunk":"@@ -9,7 +9,15 @@ fn main() {\n     let num_generations: u8           = 100;\n     let mut board:       Vec<Vec<u8>> = vec![vec![0; height]; width];\n     populate_board_random(&mut board, 20);\n+    println!(\"  Initial state ('+' is a live cell; dead cells are empty):\");\n     print_board(&board);\n+    for cur_gen in 0..num_generations {\n+        // It seems to me here that I have a lot of choices:\n+        // 1. Give ownership of board to advance_generation wholesale (advance_generation would then return a new board)\n+        // 2. Lend advance_generation borrow an immutable reference to board and then return a new board with the new state","path":"src/main.rs","position":9,"original_position":9,"commit_id":"61a04f97f314dfa8674fcbe242522400f7e61c48","original_commit_id":"61a04f97f314dfa8674fcbe242522400f7e61c48","user":{"login":"nathanbw","id":95544,"avatar_url":"https://avatars.githubusercontent.com/u/95544?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanbw","html_url":"https://github.com/nathanbw","followers_url":"https://api.github.com/users/nathanbw/followers","following_url":"https://api.github.com/users/nathanbw/following{/other_user}","gists_url":"https://api.github.com/users/nathanbw/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanbw/subscriptions","organizations_url":"https://api.github.com/users/nathanbw/orgs","repos_url":"https://api.github.com/users/nathanbw/repos","events_url":"https://api.github.com/users/nathanbw/events{/privacy}","received_events_url":"https://api.github.com/users/nathanbw/received_events","type":"User","site_admin":false},"body":"My understanding of this approach is that I would need to update the signature of ```advance_generation()`` to borrow a reference to ```board```, use it for calculating the new board, and then update the function to return the new state in a new Vec<Vec<u8>>.\r\n\r\nVerdict: Exactly the same as Approach 1. above, except the deallocation of the board happens after ```advance_generation()``` returns instead of just before it.","created_at":"2016-06-08T19:36:02Z","updated_at":"2016-06-08T19:36:02Z","html_url":"https://github.com/nathanbw/game-of-life/pull/1#discussion_r66324043","pull_request_url":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/nathanbw/game-of-life/pulls/comments/66324043"},"html":{"href":"https://github.com/nathanbw/game-of-life/pull/1#discussion_r66324043"},"pull_request":{"href":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1","id":73099484,"html_url":"https://github.com/nathanbw/game-of-life/pull/1","diff_url":"https://github.com/nathanbw/game-of-life/pull/1.diff","patch_url":"https://github.com/nathanbw/game-of-life/pull/1.patch","issue_url":"https://api.github.com/repos/nathanbw/game-of-life/issues/1","number":1,"state":"open","locked":false,"title":"Decision time: how should advance_generation work?","user":{"login":"nathanbw","id":95544,"avatar_url":"https://avatars.githubusercontent.com/u/95544?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanbw","html_url":"https://github.com/nathanbw","followers_url":"https://api.github.com/users/nathanbw/followers","following_url":"https://api.github.com/users/nathanbw/following{/other_user}","gists_url":"https://api.github.com/users/nathanbw/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanbw/subscriptions","organizations_url":"https://api.github.com/users/nathanbw/orgs","repos_url":"https://api.github.com/users/nathanbw/repos","events_url":"https://api.github.com/users/nathanbw/events{/privacy}","received_events_url":"https://api.github.com/users/nathanbw/received_events","type":"User","site_admin":false},"body":"This PR is a WIP (not ready to merge). It is here to make discussion about the code easier.","created_at":"2016-06-08T18:47:13Z","updated_at":"2016-06-08T19:36:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"999f5fbe866c772e30c9974a68571c545d408f20","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1/commits","review_comments_url":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1/comments","review_comment_url":"https://api.github.com/repos/nathanbw/game-of-life/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nathanbw/game-of-life/issues/1/comments","statuses_url":"https://api.github.com/repos/nathanbw/game-of-life/statuses/61a04f97f314dfa8674fcbe242522400f7e61c48","head":{"label":"nathanbw:nw/wip","ref":"nw/wip","sha":"61a04f97f314dfa8674fcbe242522400f7e61c48","user":{"login":"nathanbw","id":95544,"avatar_url":"https://avatars.githubusercontent.com/u/95544?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanbw","html_url":"https://github.com/nathanbw","followers_url":"https://api.github.com/users/nathanbw/followers","following_url":"https://api.github.com/users/nathanbw/following{/other_user}","gists_url":"https://api.github.com/users/nathanbw/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanbw/subscriptions","organizations_url":"https://api.github.com/users/nathanbw/orgs","repos_url":"https://api.github.com/users/nathanbw/repos","events_url":"https://api.github.com/users/nathanbw/events{/privacy}","received_events_url":"https://api.github.com/users/nathanbw/received_events","type":"User","site_admin":false},"repo":{"id":60718669,"name":"game-of-life","full_name":"nathanbw/game-of-life","owner":{"login":"nathanbw","id":95544,"avatar_url":"https://avatars.githubusercontent.com/u/95544?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanbw","html_url":"https://github.com/nathanbw","followers_url":"https://api.github.com/users/nathanbw/followers","following_url":"https://api.github.com/users/nathanbw/following{/other_user}","gists_url":"https://api.github.com/users/nathanbw/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanbw/subscriptions","organizations_url":"https://api.github.com/users/nathanbw/orgs","repos_url":"https://api.github.com/users/nathanbw/repos","events_url":"https://api.github.com/users/nathanbw/events{/privacy}","received_events_url":"https://api.github.com/users/nathanbw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nathanbw/game-of-life","description":"Conway's Game of Life implemented in rust","fork":false,"url":"https://api.github.com/repos/nathanbw/game-of-life","forks_url":"https://api.github.com/repos/nathanbw/game-of-life/forks","keys_url":"https://api.github.com/repos/nathanbw/game-of-life/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathanbw/game-of-life/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathanbw/game-of-life/teams","hooks_url":"https://api.github.com/repos/nathanbw/game-of-life/hooks","issue_events_url":"https://api.github.com/repos/nathanbw/game-of-life/issues/events{/number}","events_url":"https://api.github.com/repos/nathanbw/game-of-life/events","assignees_url":"https://api.github.com/repos/nathanbw/game-of-life/assignees{/user}","branches_url":"https://api.github.com/repos/nathanbw/game-of-life/branches{/branch}","tags_url":"https://api.github.com/repos/nathanbw/game-of-life/tags","blobs_url":"https://api.github.com/repos/nathanbw/game-of-life/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathanbw/game-of-life/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathanbw/game-of-life/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathanbw/game-of-life/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathanbw/game-of-life/statuses/{sha}","languages_url":"https://api.github.com/repos/nathanbw/game-of-life/languages","stargazers_url":"https://api.github.com/repos/nathanbw/game-of-life/stargazers","contributors_url":"https://api.github.com/repos/nathanbw/game-of-life/contributors","subscribers_url":"https://api.github.com/repos/nathanbw/game-of-life/subscribers","subscription_url":"https://api.github.com/repos/nathanbw/game-of-life/subscription","commits_url":"https://api.github.com/repos/nathanbw/game-of-life/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathanbw/game-of-life/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathanbw/game-of-life/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathanbw/game-of-life/issues/comments{/number}","contents_url":"https://api.github.com/repos/nathanbw/game-of-life/contents/{+path}","compare_url":"https://api.github.com/repos/nathanbw/game-of-life/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathanbw/game-of-life/merges","archive_url":"https://api.github.com/repos/nathanbw/game-of-life/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathanbw/game-of-life/downloads","issues_url":"https://api.github.com/repos/nathanbw/game-of-life/issues{/number}","pulls_url":"https://api.github.com/repos/nathanbw/game-of-life/pulls{/number}","milestones_url":"https://api.github.com/repos/nathanbw/game-of-life/milestones{/number}","notifications_url":"https://api.github.com/repos/nathanbw/game-of-life/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathanbw/game-of-life/labels{/name}","releases_url":"https://api.github.com/repos/nathanbw/game-of-life/releases{/id}","deployments_url":"https://api.github.com/repos/nathanbw/game-of-life/deployments","created_at":"2016-06-08T17:57:55Z","updated_at":"2016-06-08T18:02:32Z","pushed_at":"2016-06-08T18:58:22Z","git_url":"git://github.com/nathanbw/game-of-life.git","ssh_url":"git@github.com:nathanbw/game-of-life.git","clone_url":"https://github.com/nathanbw/game-of-life.git","svn_url":"https://github.com/nathanbw/game-of-life","homepage":null,"size":4,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"nathanbw:master","ref":"master","sha":"e780ece0b3424b00eb7e2c18bdd1093c4930b09f","user":{"login":"nathanbw","id":95544,"avatar_url":"https://avatars.githubusercontent.com/u/95544?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanbw","html_url":"https://github.com/nathanbw","followers_url":"https://api.github.com/users/nathanbw/followers","following_url":"https://api.github.com/users/nathanbw/following{/other_user}","gists_url":"https://api.github.com/users/nathanbw/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanbw/subscriptions","organizations_url":"https://api.github.com/users/nathanbw/orgs","repos_url":"https://api.github.com/users/nathanbw/repos","events_url":"https://api.github.com/users/nathanbw/events{/privacy}","received_events_url":"https://api.github.com/users/nathanbw/received_events","type":"User","site_admin":false},"repo":{"id":60718669,"name":"game-of-life","full_name":"nathanbw/game-of-life","owner":{"login":"nathanbw","id":95544,"avatar_url":"https://avatars.githubusercontent.com/u/95544?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanbw","html_url":"https://github.com/nathanbw","followers_url":"https://api.github.com/users/nathanbw/followers","following_url":"https://api.github.com/users/nathanbw/following{/other_user}","gists_url":"https://api.github.com/users/nathanbw/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanbw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanbw/subscriptions","organizations_url":"https://api.github.com/users/nathanbw/orgs","repos_url":"https://api.github.com/users/nathanbw/repos","events_url":"https://api.github.com/users/nathanbw/events{/privacy}","received_events_url":"https://api.github.com/users/nathanbw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nathanbw/game-of-life","description":"Conway's Game of Life implemented in rust","fork":false,"url":"https://api.github.com/repos/nathanbw/game-of-life","forks_url":"https://api.github.com/repos/nathanbw/game-of-life/forks","keys_url":"https://api.github.com/repos/nathanbw/game-of-life/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathanbw/game-of-life/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathanbw/game-of-life/teams","hooks_url":"https://api.github.com/repos/nathanbw/game-of-life/hooks","issue_events_url":"https://api.github.com/repos/nathanbw/game-of-life/issues/events{/number}","events_url":"https://api.github.com/repos/nathanbw/game-of-life/events","assignees_url":"https://api.github.com/repos/nathanbw/game-of-life/assignees{/user}","branches_url":"https://api.github.com/repos/nathanbw/game-of-life/branches{/branch}","tags_url":"https://api.github.com/repos/nathanbw/game-of-life/tags","blobs_url":"https://api.github.com/repos/nathanbw/game-of-life/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathanbw/game-of-life/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathanbw/game-of-life/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathanbw/game-of-life/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathanbw/game-of-life/statuses/{sha}","languages_url":"https://api.github.com/repos/nathanbw/game-of-life/languages","stargazers_url":"https://api.github.com/repos/nathanbw/game-of-life/stargazers","contributors_url":"https://api.github.com/repos/nathanbw/game-of-life/contributors","subscribers_url":"https://api.github.com/repos/nathanbw/game-of-life/subscribers","subscription_url":"https://api.github.com/repos/nathanbw/game-of-life/subscription","commits_url":"https://api.github.com/repos/nathanbw/game-of-life/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathanbw/game-of-life/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathanbw/game-of-life/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathanbw/game-of-life/issues/comments{/number}","contents_url":"https://api.github.com/repos/nathanbw/game-of-life/contents/{+path}","compare_url":"https://api.github.com/repos/nathanbw/game-of-life/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathanbw/game-of-life/merges","archive_url":"https://api.github.com/repos/nathanbw/game-of-life/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathanbw/game-of-life/downloads","issues_url":"https://api.github.com/repos/nathanbw/game-of-life/issues{/number}","pulls_url":"https://api.github.com/repos/nathanbw/game-of-life/pulls{/number}","milestones_url":"https://api.github.com/repos/nathanbw/game-of-life/milestones{/number}","notifications_url":"https://api.github.com/repos/nathanbw/game-of-life/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathanbw/game-of-life/labels{/name}","releases_url":"https://api.github.com/repos/nathanbw/game-of-life/releases{/id}","deployments_url":"https://api.github.com/repos/nathanbw/game-of-life/deployments","created_at":"2016-06-08T17:57:55Z","updated_at":"2016-06-08T18:02:32Z","pushed_at":"2016-06-08T18:58:22Z","git_url":"git://github.com/nathanbw/game-of-life.git","ssh_url":"git@github.com:nathanbw/game-of-life.git","clone_url":"https://github.com/nathanbw/game-of-life.git","svn_url":"https://github.com/nathanbw/game-of-life","homepage":null,"size":4,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1"},"html":{"href":"https://github.com/nathanbw/game-of-life/pull/1"},"issue":{"href":"https://api.github.com/repos/nathanbw/game-of-life/issues/1"},"comments":{"href":"https://api.github.com/repos/nathanbw/game-of-life/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/nathanbw/game-of-life/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nathanbw/game-of-life/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/nathanbw/game-of-life/statuses/61a04f97f314dfa8674fcbe242522400f7e61c48"}}}}
{"actor":{"display_login":"nathanbw"}}