{"action":"created","comment":{"url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/comments/26454875","id":26454875,"diff_hunk":"@@ -1,18 +1,19 @@\n-#[derive(Copy)]\n-pub struct LogicState {\n+pub trait GameEvent {\n+  fn works(&self) -> bool;\n+}\n+\n+pub struct LogicState<'a> {\n   good: bool,\n   edge_count: usize,\n-  x: f32,\n-  y: f32\n+  events: Vec<&'a GameEvent>","path":"game_logic/src/lib.rs","position":12,"original_position":12,"commit_id":"8582ed5ff34b788643d70ea8b23869b167194465","original_commit_id":"8582ed5ff34b788643d70ea8b23869b167194465","user":{"login":"rschifflin","id":2578071,"avatar_url":"https://avatars.githubusercontent.com/u/2578071?v=3","gravatar_id":"","url":"https://api.github.com/users/rschifflin","html_url":"https://github.com/rschifflin","followers_url":"https://api.github.com/users/rschifflin/followers","following_url":"https://api.github.com/users/rschifflin/following{/other_user}","gists_url":"https://api.github.com/users/rschifflin/gists{/gist_id}","starred_url":"https://api.github.com/users/rschifflin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rschifflin/subscriptions","organizations_url":"https://api.github.com/users/rschifflin/orgs","repos_url":"https://api.github.com/users/rschifflin/repos","events_url":"https://api.github.com/users/rschifflin/events{/privacy}","received_events_url":"https://api.github.com/users/rschifflin/received_events","type":"User","site_admin":false},"body":"This makes a Vec of Trait Objects (dynamically dispatched type-erased objects), which is different than a Vec of some type which implements GameEvent like \r\n```rust\r\npub struct LogicState<'a, T> where T: GameEvent {\r\n  ...\r\n  events: Vec<&'a T>\r\n}\r\n```\r\nIs that what you intended?","created_at":"2015-03-16T00:45:41Z","updated_at":"2015-03-16T00:45:41Z","html_url":"https://github.com/acmcarther/rust-roguelike/pull/8#discussion_r26454875","pull_request_url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/comments/26454875"},"html":{"href":"https://github.com/acmcarther/rust-roguelike/pull/8#discussion_r26454875"},"pull_request":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8","id":31209679,"html_url":"https://github.com/acmcarther/rust-roguelike/pull/8","diff_url":"https://github.com/acmcarther/rust-roguelike/pull/8.diff","patch_url":"https://github.com/acmcarther/rust-roguelike/pull/8.patch","issue_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/8","number":8,"state":"open","locked":false,"title":"Made state mutable for new events vec","user":{"login":"acmcarther","id":1660129,"avatar_url":"https://avatars.githubusercontent.com/u/1660129?v=3","gravatar_id":"","url":"https://api.github.com/users/acmcarther","html_url":"https://github.com/acmcarther","followers_url":"https://api.github.com/users/acmcarther/followers","following_url":"https://api.github.com/users/acmcarther/following{/other_user}","gists_url":"https://api.github.com/users/acmcarther/gists{/gist_id}","starred_url":"https://api.github.com/users/acmcarther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acmcarther/subscriptions","organizations_url":"https://api.github.com/users/acmcarther/orgs","repos_url":"https://api.github.com/users/acmcarther/repos","events_url":"https://api.github.com/users/acmcarther/events{/privacy}","received_events_url":"https://api.github.com/users/acmcarther/received_events","type":"User","site_admin":false},"body":"@rschifflin Plz review\r\n\r\nIn adding an events field to LogicState, I had make the events vec a reference. This made for all kinds of weirdness, so I instead made everything mutate the original state. Pretty weird.","created_at":"2015-03-15T23:27:53Z","updated_at":"2015-03-16T00:45:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99cb43c656eef694c5f49680511e42a73eb3caea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8/commits","review_comments_url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8/comments","review_comment_url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/8/comments","statuses_url":"https://api.github.com/repos/acmcarther/rust-roguelike/statuses/8582ed5ff34b788643d70ea8b23869b167194465","head":{"label":"acmcarther:acm-mutable-state","ref":"acm-mutable-state","sha":"8582ed5ff34b788643d70ea8b23869b167194465","user":{"login":"acmcarther","id":1660129,"avatar_url":"https://avatars.githubusercontent.com/u/1660129?v=3","gravatar_id":"","url":"https://api.github.com/users/acmcarther","html_url":"https://github.com/acmcarther","followers_url":"https://api.github.com/users/acmcarther/followers","following_url":"https://api.github.com/users/acmcarther/following{/other_user}","gists_url":"https://api.github.com/users/acmcarther/gists{/gist_id}","starred_url":"https://api.github.com/users/acmcarther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acmcarther/subscriptions","organizations_url":"https://api.github.com/users/acmcarther/orgs","repos_url":"https://api.github.com/users/acmcarther/repos","events_url":"https://api.github.com/users/acmcarther/events{/privacy}","received_events_url":"https://api.github.com/users/acmcarther/received_events","type":"User","site_admin":false},"repo":{"id":32047081,"name":"rust-roguelike","full_name":"acmcarther/rust-roguelike","owner":{"login":"acmcarther","id":1660129,"avatar_url":"https://avatars.githubusercontent.com/u/1660129?v=3","gravatar_id":"","url":"https://api.github.com/users/acmcarther","html_url":"https://github.com/acmcarther","followers_url":"https://api.github.com/users/acmcarther/followers","following_url":"https://api.github.com/users/acmcarther/following{/other_user}","gists_url":"https://api.github.com/users/acmcarther/gists{/gist_id}","starred_url":"https://api.github.com/users/acmcarther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acmcarther/subscriptions","organizations_url":"https://api.github.com/users/acmcarther/orgs","repos_url":"https://api.github.com/users/acmcarther/repos","events_url":"https://api.github.com/users/acmcarther/events{/privacy}","received_events_url":"https://api.github.com/users/acmcarther/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acmcarther/rust-roguelike","description":"","fork":false,"url":"https://api.github.com/repos/acmcarther/rust-roguelike","forks_url":"https://api.github.com/repos/acmcarther/rust-roguelike/forks","keys_url":"https://api.github.com/repos/acmcarther/rust-roguelike/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acmcarther/rust-roguelike/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acmcarther/rust-roguelike/teams","hooks_url":"https://api.github.com/repos/acmcarther/rust-roguelike/hooks","issue_events_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/events{/number}","events_url":"https://api.github.com/repos/acmcarther/rust-roguelike/events","assignees_url":"https://api.github.com/repos/acmcarther/rust-roguelike/assignees{/user}","branches_url":"https://api.github.com/repos/acmcarther/rust-roguelike/branches{/branch}","tags_url":"https://api.github.com/repos/acmcarther/rust-roguelike/tags","blobs_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/refs{/sha}","trees_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acmcarther/rust-roguelike/statuses/{sha}","languages_url":"https://api.github.com/repos/acmcarther/rust-roguelike/languages","stargazers_url":"https://api.github.com/repos/acmcarther/rust-roguelike/stargazers","contributors_url":"https://api.github.com/repos/acmcarther/rust-roguelike/contributors","subscribers_url":"https://api.github.com/repos/acmcarther/rust-roguelike/subscribers","subscription_url":"https://api.github.com/repos/acmcarther/rust-roguelike/subscription","commits_url":"https://api.github.com/repos/acmcarther/rust-roguelike/commits{/sha}","git_commits_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/commits{/sha}","comments_url":"https://api.github.com/repos/acmcarther/rust-roguelike/comments{/number}","issue_comment_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/comments{/number}","contents_url":"https://api.github.com/repos/acmcarther/rust-roguelike/contents/{+path}","compare_url":"https://api.github.com/repos/acmcarther/rust-roguelike/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acmcarther/rust-roguelike/merges","archive_url":"https://api.github.com/repos/acmcarther/rust-roguelike/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acmcarther/rust-roguelike/downloads","issues_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues{/number}","pulls_url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls{/number}","milestones_url":"https://api.github.com/repos/acmcarther/rust-roguelike/milestones{/number}","notifications_url":"https://api.github.com/repos/acmcarther/rust-roguelike/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acmcarther/rust-roguelike/labels{/name}","releases_url":"https://api.github.com/repos/acmcarther/rust-roguelike/releases{/id}","created_at":"2015-03-11T23:42:00Z","updated_at":"2015-03-15T20:35:15Z","pushed_at":"2015-03-15T23:25:58Z","git_url":"git://github.com/acmcarther/rust-roguelike.git","ssh_url":"git@github.com:acmcarther/rust-roguelike.git","clone_url":"https://github.com/acmcarther/rust-roguelike.git","svn_url":"https://github.com/acmcarther/rust-roguelike","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"acmcarther:master","ref":"master","sha":"d91df1a13c8a82d0d2e2777279df048d8cc55209","user":{"login":"acmcarther","id":1660129,"avatar_url":"https://avatars.githubusercontent.com/u/1660129?v=3","gravatar_id":"","url":"https://api.github.com/users/acmcarther","html_url":"https://github.com/acmcarther","followers_url":"https://api.github.com/users/acmcarther/followers","following_url":"https://api.github.com/users/acmcarther/following{/other_user}","gists_url":"https://api.github.com/users/acmcarther/gists{/gist_id}","starred_url":"https://api.github.com/users/acmcarther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acmcarther/subscriptions","organizations_url":"https://api.github.com/users/acmcarther/orgs","repos_url":"https://api.github.com/users/acmcarther/repos","events_url":"https://api.github.com/users/acmcarther/events{/privacy}","received_events_url":"https://api.github.com/users/acmcarther/received_events","type":"User","site_admin":false},"repo":{"id":32047081,"name":"rust-roguelike","full_name":"acmcarther/rust-roguelike","owner":{"login":"acmcarther","id":1660129,"avatar_url":"https://avatars.githubusercontent.com/u/1660129?v=3","gravatar_id":"","url":"https://api.github.com/users/acmcarther","html_url":"https://github.com/acmcarther","followers_url":"https://api.github.com/users/acmcarther/followers","following_url":"https://api.github.com/users/acmcarther/following{/other_user}","gists_url":"https://api.github.com/users/acmcarther/gists{/gist_id}","starred_url":"https://api.github.com/users/acmcarther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acmcarther/subscriptions","organizations_url":"https://api.github.com/users/acmcarther/orgs","repos_url":"https://api.github.com/users/acmcarther/repos","events_url":"https://api.github.com/users/acmcarther/events{/privacy}","received_events_url":"https://api.github.com/users/acmcarther/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acmcarther/rust-roguelike","description":"","fork":false,"url":"https://api.github.com/repos/acmcarther/rust-roguelike","forks_url":"https://api.github.com/repos/acmcarther/rust-roguelike/forks","keys_url":"https://api.github.com/repos/acmcarther/rust-roguelike/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acmcarther/rust-roguelike/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acmcarther/rust-roguelike/teams","hooks_url":"https://api.github.com/repos/acmcarther/rust-roguelike/hooks","issue_events_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/events{/number}","events_url":"https://api.github.com/repos/acmcarther/rust-roguelike/events","assignees_url":"https://api.github.com/repos/acmcarther/rust-roguelike/assignees{/user}","branches_url":"https://api.github.com/repos/acmcarther/rust-roguelike/branches{/branch}","tags_url":"https://api.github.com/repos/acmcarther/rust-roguelike/tags","blobs_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/refs{/sha}","trees_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acmcarther/rust-roguelike/statuses/{sha}","languages_url":"https://api.github.com/repos/acmcarther/rust-roguelike/languages","stargazers_url":"https://api.github.com/repos/acmcarther/rust-roguelike/stargazers","contributors_url":"https://api.github.com/repos/acmcarther/rust-roguelike/contributors","subscribers_url":"https://api.github.com/repos/acmcarther/rust-roguelike/subscribers","subscription_url":"https://api.github.com/repos/acmcarther/rust-roguelike/subscription","commits_url":"https://api.github.com/repos/acmcarther/rust-roguelike/commits{/sha}","git_commits_url":"https://api.github.com/repos/acmcarther/rust-roguelike/git/commits{/sha}","comments_url":"https://api.github.com/repos/acmcarther/rust-roguelike/comments{/number}","issue_comment_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/comments{/number}","contents_url":"https://api.github.com/repos/acmcarther/rust-roguelike/contents/{+path}","compare_url":"https://api.github.com/repos/acmcarther/rust-roguelike/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acmcarther/rust-roguelike/merges","archive_url":"https://api.github.com/repos/acmcarther/rust-roguelike/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acmcarther/rust-roguelike/downloads","issues_url":"https://api.github.com/repos/acmcarther/rust-roguelike/issues{/number}","pulls_url":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls{/number}","milestones_url":"https://api.github.com/repos/acmcarther/rust-roguelike/milestones{/number}","notifications_url":"https://api.github.com/repos/acmcarther/rust-roguelike/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acmcarther/rust-roguelike/labels{/name}","releases_url":"https://api.github.com/repos/acmcarther/rust-roguelike/releases{/id}","created_at":"2015-03-11T23:42:00Z","updated_at":"2015-03-15T20:35:15Z","pushed_at":"2015-03-15T23:25:58Z","git_url":"git://github.com/acmcarther/rust-roguelike.git","ssh_url":"git@github.com:acmcarther/rust-roguelike.git","clone_url":"https://github.com/acmcarther/rust-roguelike.git","svn_url":"https://github.com/acmcarther/rust-roguelike","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8"},"html":{"href":"https://github.com/acmcarther/rust-roguelike/pull/8"},"issue":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/8"},"comments":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/acmcarther/rust-roguelike/statuses/8582ed5ff34b788643d70ea8b23869b167194465"}}}}