{"action":"created","comment":{"url":"https://api.github.com/repos/georust/rust-geojson/pulls/comments/23007802","id":23007802,"diff_hunk":"@@ -15,162 +15,210 @@\n // TODO\n // generic number instead of f64 for position?\n \n-extern crate serialize;\n+extern crate \"rustc-serialize\" as rustc_serialize;\n \n-use std::collections::HashMap;\n-use serialize::json::{self, ToJson};\n+use std::collections::BTreeMap;\n+use rustc_serialize::json::{self, ToJson, Json};\n \n-\n-/// ToGeoJson\n-pub trait ToGeoJson {\n-    // TODO: change this to return a generic GeoJSON object\n-    fn to_geojson(&self) -> Geometry;\n-}\n+// /// ToGeoJson\n+// pub trait ToGeoJson {\n+//     // TODO: change this to return a generic GeoJSON object\n+//     fn to_geojson(&self) -> Geometry;\n+// }\n \n \n /// Pos (alias for Positions)\n ///\n /// [GeoJSON Format Specification § 2.1.1](http://geojson.org/geojson-spec.html#positions)\n+#[derive(RustcEncodable, Clone)]\n pub struct Pos(pub Vec<f64>);\n \n impl ToJson for Pos {\n     fn to_json(&self) -> json::Json {\n-        let &Pos(ref nums) = self;\n-        nums.to_json()\n+        match self.clone() {","path":"src/lib.rs","position":null,"original_position":35,"commit_id":"0bb700e9a35bf9eb9fe3191069cad1d6b120e1a8","original_commit_id":"7ebd9bca8ddeb6aa5e68877615fdd2dd9924fdbb","user":{"login":"calvinmetcalf","id":1128607,"avatar_url":"https://avatars.githubusercontent.com/u/1128607?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinmetcalf","html_url":"https://github.com/calvinmetcalf","followers_url":"https://api.github.com/users/calvinmetcalf/followers","following_url":"https://api.github.com/users/calvinmetcalf/following{/other_user}","gists_url":"https://api.github.com/users/calvinmetcalf/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinmetcalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinmetcalf/subscriptions","organizations_url":"https://api.github.com/users/calvinmetcalf/orgs","repos_url":"https://api.github.com/users/calvinmetcalf/repos","events_url":"https://api.github.com/users/calvinmetcalf/events{/privacy}","received_events_url":"https://api.github.com/users/calvinmetcalf/received_events","type":"User","site_admin":false},"body":"that leads to a stack overflow, though the ref syntax you originally had does do the trick","created_at":"2015-01-15T13:03:38Z","updated_at":"2015-01-15T13:03:38Z","html_url":"https://github.com/georust/rust-geojson/pull/8#discussion_r23007802","pull_request_url":"https://api.github.com/repos/georust/rust-geojson/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/georust/rust-geojson/pulls/comments/23007802"},"html":{"href":"https://github.com/georust/rust-geojson/pull/8#discussion_r23007802"},"pull_request":{"href":"https://api.github.com/repos/georust/rust-geojson/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/georust/rust-geojson/pulls/8","id":27355280,"html_url":"https://github.com/georust/rust-geojson/pull/8","diff_url":"https://github.com/georust/rust-geojson/pull/8.diff","patch_url":"https://github.com/georust/rust-geojson/pull/8.patch","issue_url":"https://api.github.com/repos/georust/rust-geojson/issues/8","number":8,"state":"open","locked":false,"title":"update to version 1 compatible","user":{"login":"calvinmetcalf","id":1128607,"avatar_url":"https://avatars.githubusercontent.com/u/1128607?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinmetcalf","html_url":"https://github.com/calvinmetcalf","followers_url":"https://api.github.com/users/calvinmetcalf/followers","following_url":"https://api.github.com/users/calvinmetcalf/following{/other_user}","gists_url":"https://api.github.com/users/calvinmetcalf/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinmetcalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinmetcalf/subscriptions","organizations_url":"https://api.github.com/users/calvinmetcalf/orgs","repos_url":"https://api.github.com/users/calvinmetcalf/repos","events_url":"https://api.github.com/users/calvinmetcalf/events{/privacy}","received_events_url":"https://api.github.com/users/calvinmetcalf/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-14T14:59:22Z","updated_at":"2015-01-15T13:03:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"970757cd9a3480f22266d8db23922e3b33b07503","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/georust/rust-geojson/pulls/8/commits","review_comments_url":"https://api.github.com/repos/georust/rust-geojson/pulls/8/comments","review_comment_url":"https://api.github.com/repos/georust/rust-geojson/pulls/comments/{number}","comments_url":"https://api.github.com/repos/georust/rust-geojson/issues/8/comments","statuses_url":"https://api.github.com/repos/georust/rust-geojson/statuses/0bb700e9a35bf9eb9fe3191069cad1d6b120e1a8","head":{"label":"calvinmetcalf:update-to-1","ref":"update-to-1","sha":"0bb700e9a35bf9eb9fe3191069cad1d6b120e1a8","user":{"login":"calvinmetcalf","id":1128607,"avatar_url":"https://avatars.githubusercontent.com/u/1128607?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinmetcalf","html_url":"https://github.com/calvinmetcalf","followers_url":"https://api.github.com/users/calvinmetcalf/followers","following_url":"https://api.github.com/users/calvinmetcalf/following{/other_user}","gists_url":"https://api.github.com/users/calvinmetcalf/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinmetcalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinmetcalf/subscriptions","organizations_url":"https://api.github.com/users/calvinmetcalf/orgs","repos_url":"https://api.github.com/users/calvinmetcalf/repos","events_url":"https://api.github.com/users/calvinmetcalf/events{/privacy}","received_events_url":"https://api.github.com/users/calvinmetcalf/received_events","type":"User","site_admin":false},"repo":{"id":29209624,"name":"rust-geojson","full_name":"calvinmetcalf/rust-geojson","owner":{"login":"calvinmetcalf","id":1128607,"avatar_url":"https://avatars.githubusercontent.com/u/1128607?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinmetcalf","html_url":"https://github.com/calvinmetcalf","followers_url":"https://api.github.com/users/calvinmetcalf/followers","following_url":"https://api.github.com/users/calvinmetcalf/following{/other_user}","gists_url":"https://api.github.com/users/calvinmetcalf/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinmetcalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinmetcalf/subscriptions","organizations_url":"https://api.github.com/users/calvinmetcalf/orgs","repos_url":"https://api.github.com/users/calvinmetcalf/repos","events_url":"https://api.github.com/users/calvinmetcalf/events{/privacy}","received_events_url":"https://api.github.com/users/calvinmetcalf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calvinmetcalf/rust-geojson","description":"GeoJSON bindings and utilities for Rust","fork":true,"url":"https://api.github.com/repos/calvinmetcalf/rust-geojson","forks_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/forks","keys_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/teams","hooks_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/hooks","issue_events_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/issues/events{/number}","events_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/events","assignees_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/assignees{/user}","branches_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/branches{/branch}","tags_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/tags","blobs_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/git/refs{/sha}","trees_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/statuses/{sha}","languages_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/languages","stargazers_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/stargazers","contributors_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/contributors","subscribers_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/subscribers","subscription_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/subscription","commits_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/commits{/sha}","git_commits_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/git/commits{/sha}","comments_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/comments{/number}","issue_comment_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/issues/comments/{number}","contents_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/contents/{+path}","compare_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/merges","archive_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/downloads","issues_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/issues{/number}","pulls_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/pulls{/number}","milestones_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/milestones{/number}","notifications_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/labels{/name}","releases_url":"https://api.github.com/repos/calvinmetcalf/rust-geojson/releases{/id}","created_at":"2015-01-13T20:32:00Z","updated_at":"2015-01-13T20:32:01Z","pushed_at":"2015-01-15T13:03:18Z","git_url":"git://github.com/calvinmetcalf/rust-geojson.git","ssh_url":"git@github.com:calvinmetcalf/rust-geojson.git","clone_url":"https://github.com/calvinmetcalf/rust-geojson.git","svn_url":"https://github.com/calvinmetcalf/rust-geojson","homepage":"","size":305,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"georust:master","ref":"master","sha":"c508b19d84a6c12e076f7851f01d775d92f82e25","user":{"login":"georust","id":10320338,"avatar_url":"https://avatars.githubusercontent.com/u/10320338?v=3","gravatar_id":"","url":"https://api.github.com/users/georust","html_url":"https://github.com/georust","followers_url":"https://api.github.com/users/georust/followers","following_url":"https://api.github.com/users/georust/following{/other_user}","gists_url":"https://api.github.com/users/georust/gists{/gist_id}","starred_url":"https://api.github.com/users/georust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georust/subscriptions","organizations_url":"https://api.github.com/users/georust/orgs","repos_url":"https://api.github.com/users/georust/repos","events_url":"https://api.github.com/users/georust/events{/privacy}","received_events_url":"https://api.github.com/users/georust/received_events","type":"Organization","site_admin":false},"repo":{"id":24011994,"name":"rust-geojson","full_name":"georust/rust-geojson","owner":{"login":"georust","id":10320338,"avatar_url":"https://avatars.githubusercontent.com/u/10320338?v=3","gravatar_id":"","url":"https://api.github.com/users/georust","html_url":"https://github.com/georust","followers_url":"https://api.github.com/users/georust/followers","following_url":"https://api.github.com/users/georust/following{/other_user}","gists_url":"https://api.github.com/users/georust/gists{/gist_id}","starred_url":"https://api.github.com/users/georust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georust/subscriptions","organizations_url":"https://api.github.com/users/georust/orgs","repos_url":"https://api.github.com/users/georust/repos","events_url":"https://api.github.com/users/georust/events{/privacy}","received_events_url":"https://api.github.com/users/georust/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/georust/rust-geojson","description":"GeoJSON bindings and utilities for Rust","fork":false,"url":"https://api.github.com/repos/georust/rust-geojson","forks_url":"https://api.github.com/repos/georust/rust-geojson/forks","keys_url":"https://api.github.com/repos/georust/rust-geojson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/georust/rust-geojson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/georust/rust-geojson/teams","hooks_url":"https://api.github.com/repos/georust/rust-geojson/hooks","issue_events_url":"https://api.github.com/repos/georust/rust-geojson/issues/events{/number}","events_url":"https://api.github.com/repos/georust/rust-geojson/events","assignees_url":"https://api.github.com/repos/georust/rust-geojson/assignees{/user}","branches_url":"https://api.github.com/repos/georust/rust-geojson/branches{/branch}","tags_url":"https://api.github.com/repos/georust/rust-geojson/tags","blobs_url":"https://api.github.com/repos/georust/rust-geojson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/georust/rust-geojson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/georust/rust-geojson/git/refs{/sha}","trees_url":"https://api.github.com/repos/georust/rust-geojson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/georust/rust-geojson/statuses/{sha}","languages_url":"https://api.github.com/repos/georust/rust-geojson/languages","stargazers_url":"https://api.github.com/repos/georust/rust-geojson/stargazers","contributors_url":"https://api.github.com/repos/georust/rust-geojson/contributors","subscribers_url":"https://api.github.com/repos/georust/rust-geojson/subscribers","subscription_url":"https://api.github.com/repos/georust/rust-geojson/subscription","commits_url":"https://api.github.com/repos/georust/rust-geojson/commits{/sha}","git_commits_url":"https://api.github.com/repos/georust/rust-geojson/git/commits{/sha}","comments_url":"https://api.github.com/repos/georust/rust-geojson/comments{/number}","issue_comment_url":"https://api.github.com/repos/georust/rust-geojson/issues/comments/{number}","contents_url":"https://api.github.com/repos/georust/rust-geojson/contents/{+path}","compare_url":"https://api.github.com/repos/georust/rust-geojson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/georust/rust-geojson/merges","archive_url":"https://api.github.com/repos/georust/rust-geojson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/georust/rust-geojson/downloads","issues_url":"https://api.github.com/repos/georust/rust-geojson/issues{/number}","pulls_url":"https://api.github.com/repos/georust/rust-geojson/pulls{/number}","milestones_url":"https://api.github.com/repos/georust/rust-geojson/milestones{/number}","notifications_url":"https://api.github.com/repos/georust/rust-geojson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/georust/rust-geojson/labels{/name}","releases_url":"https://api.github.com/repos/georust/rust-geojson/releases{/id}","created_at":"2014-09-14T02:49:21Z","updated_at":"2015-01-12T20:32:46Z","pushed_at":"2015-01-10T21:02:43Z","git_url":"git://github.com/georust/rust-geojson.git","ssh_url":"git@github.com:georust/rust-geojson.git","clone_url":"https://github.com/georust/rust-geojson.git","svn_url":"https://github.com/georust/rust-geojson","homepage":"","size":305,"stargazers_count":4,"watchers_count":4,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/georust/rust-geojson/pulls/8"},"html":{"href":"https://github.com/georust/rust-geojson/pull/8"},"issue":{"href":"https://api.github.com/repos/georust/rust-geojson/issues/8"},"comments":{"href":"https://api.github.com/repos/georust/rust-geojson/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/georust/rust-geojson/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/georust/rust-geojson/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/georust/rust-geojson/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/georust/rust-geojson/statuses/0bb700e9a35bf9eb9fe3191069cad1d6b120e1a8"}}}}