{"action":"created","comment":{"url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/comments/54904196","id":54904196,"diff_hunk":"@@ -15,45 +15,59 @@\n // Please review the Licences for the specific language governing permissions and limitations\n // relating to use of the SAFE Network Software.\n \n-use cbor::{Encoder, Decoder};\n+use bincode::SizeLimit;\n+use bincode::rustc_serialize::{decode, decode_from, DecodingError, encode, encode_into,\n+                               EncodingError};\n use rustc_serialize::{Encodable, Decodable};\n+use std::io::{Read, Write};\n \n quick_error! {\n-    /// Wrapper for Serialisation Errors. This is present because cbor code paths don't always return a\n-    /// Result - they return an Option too.\n+    /// Serialisation error.\n     #[derive(Debug)]\n     pub enum SerialisationError {\n-        /// Encapsulated Cbor Error\n-        CborError(err: ::cbor::CborError) {\n-            description(\"Cbor error\")\n-            display(\"Cbor error: {}\", err)\n+        /// Error during serialisation (encoding).\n+        SerialiseError(err: EncodingError) {\n+            description(\"Serialise error\")\n+            display(\"Serialise error: {}\", err)\n             cause(err)\n             from()\n         }\n-        /// To convert Option to a Result when deserialisation is unsuccessful and returns an\n-        /// `Option::None`\n-        UnsuccessfulDecode {\n-            description(\"Unsuccessful decode.\")\n-            display(\"Unsuccessful decode. `deserialise` returned `None`\")\n+\n+        /// Error during deserialisation (decoding).\n+        DeserialiseError(err: DecodingError) {\n+            description(\"Deserialise error\")\n+            display(\"Deserialise error: {}\", err)\n+            cause(err)\n+            from()\n         }\n     }\n }\n \n-/// Function to serialise an Encodable type\n+/// Serialise an Encodable type\n pub fn serialise<T>(data: &T) -> Result<Vec<u8>, SerialisationError>\n     where T: Encodable\n {\n-    let mut encoder = Encoder::from_memory();\n-    try!(encoder.encode(&[data]));\n-    Ok(encoder.into_bytes())\n+    encode(data, SizeLimit::Infinite).map_err(From::from)\n+}\n+\n+/// Serialise directly to a Writ","path":"src/serialisation.rs","position":55,"original_position":55,"commit_id":"01b916aca90487bae9ca3303dce950b9fdaefaeb","original_commit_id":"01b916aca90487bae9ca3303dce950b9fdaefaeb","user":{"login":"dirvine","id":123627,"avatar_url":"https://avatars.githubusercontent.com/u/123627?v=3","gravatar_id":"","url":"https://api.github.com/users/dirvine","html_url":"https://github.com/dirvine","followers_url":"https://api.github.com/users/dirvine/followers","following_url":"https://api.github.com/users/dirvine/following{/other_user}","gists_url":"https://api.github.com/users/dirvine/gists{/gist_id}","starred_url":"https://api.github.com/users/dirvine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirvine/subscriptions","organizations_url":"https://api.github.com/users/dirvine/orgs","repos_url":"https://api.github.com/users/dirvine/repos","events_url":"https://api.github.com/users/dirvine/events{/privacy}","received_events_url":"https://api.github.com/users/dirvine/received_events","type":"User","site_admin":false},"body":"Typo ","created_at":"2016-03-03T16:23:33Z","updated_at":"2016-03-03T16:23:33Z","html_url":"https://github.com/maidsafe/maidsafe_utilities/pull/32#discussion_r54904196","pull_request_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/comments/54904196"},"html":{"href":"https://github.com/maidsafe/maidsafe_utilities/pull/32#discussion_r54904196"},"pull_request":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32","id":61580235,"html_url":"https://github.com/maidsafe/maidsafe_utilities/pull/32","diff_url":"https://github.com/maidsafe/maidsafe_utilities/pull/32.diff","patch_url":"https://github.com/maidsafe/maidsafe_utilities/pull/32.patch","issue_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/issues/32","number":32,"state":"open","locked":false,"title":"Replace cbor with bincode","user":{"login":"madadam","id":5271,"avatar_url":"https://avatars.githubusercontent.com/u/5271?v=3","gravatar_id":"","url":"https://api.github.com/users/madadam","html_url":"https://github.com/madadam","followers_url":"https://api.github.com/users/madadam/followers","following_url":"https://api.github.com/users/madadam/following{/other_user}","gists_url":"https://api.github.com/users/madadam/gists{/gist_id}","starred_url":"https://api.github.com/users/madadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madadam/subscriptions","organizations_url":"https://api.github.com/users/madadam/orgs","repos_url":"https://api.github.com/users/madadam/repos","events_url":"https://api.github.com/users/madadam/events{/privacy}","received_events_url":"https://api.github.com/users/madadam/received_events","type":"User","site_admin":false},"body":"\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.svg\" height=\"40\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/maidsafe/maidsafe_utilities/32)\n<!-- Reviewable:end -->\n","created_at":"2016-03-03T15:57:15Z","updated_at":"2016-03-03T16:23:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3eed87775a89dd3de58e2c89f2b25100e182668c","assignee":{"login":"ustulation","id":8788153,"avatar_url":"https://avatars.githubusercontent.com/u/8788153?v=3","gravatar_id":"","url":"https://api.github.com/users/ustulation","html_url":"https://github.com/ustulation","followers_url":"https://api.github.com/users/ustulation/followers","following_url":"https://api.github.com/users/ustulation/following{/other_user}","gists_url":"https://api.github.com/users/ustulation/gists{/gist_id}","starred_url":"https://api.github.com/users/ustulation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ustulation/subscriptions","organizations_url":"https://api.github.com/users/ustulation/orgs","repos_url":"https://api.github.com/users/ustulation/repos","events_url":"https://api.github.com/users/ustulation/events{/privacy}","received_events_url":"https://api.github.com/users/ustulation/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32/commits","review_comments_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32/comments","review_comment_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/issues/32/comments","statuses_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/statuses/01b916aca90487bae9ca3303dce950b9fdaefaeb","head":{"label":"madadam:bincode","ref":"bincode","sha":"01b916aca90487bae9ca3303dce950b9fdaefaeb","user":{"login":"madadam","id":5271,"avatar_url":"https://avatars.githubusercontent.com/u/5271?v=3","gravatar_id":"","url":"https://api.github.com/users/madadam","html_url":"https://github.com/madadam","followers_url":"https://api.github.com/users/madadam/followers","following_url":"https://api.github.com/users/madadam/following{/other_user}","gists_url":"https://api.github.com/users/madadam/gists{/gist_id}","starred_url":"https://api.github.com/users/madadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madadam/subscriptions","organizations_url":"https://api.github.com/users/madadam/orgs","repos_url":"https://api.github.com/users/madadam/repos","events_url":"https://api.github.com/users/madadam/events{/privacy}","received_events_url":"https://api.github.com/users/madadam/received_events","type":"User","site_admin":false},"repo":{"id":53063391,"name":"maidsafe_utilities","full_name":"madadam/maidsafe_utilities","owner":{"login":"madadam","id":5271,"avatar_url":"https://avatars.githubusercontent.com/u/5271?v=3","gravatar_id":"","url":"https://api.github.com/users/madadam","html_url":"https://github.com/madadam","followers_url":"https://api.github.com/users/madadam/followers","following_url":"https://api.github.com/users/madadam/following{/other_user}","gists_url":"https://api.github.com/users/madadam/gists{/gist_id}","starred_url":"https://api.github.com/users/madadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madadam/subscriptions","organizations_url":"https://api.github.com/users/madadam/orgs","repos_url":"https://api.github.com/users/madadam/repos","events_url":"https://api.github.com/users/madadam/events{/privacy}","received_events_url":"https://api.github.com/users/madadam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/madadam/maidsafe_utilities","description":"Utility functions","fork":true,"url":"https://api.github.com/repos/madadam/maidsafe_utilities","forks_url":"https://api.github.com/repos/madadam/maidsafe_utilities/forks","keys_url":"https://api.github.com/repos/madadam/maidsafe_utilities/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madadam/maidsafe_utilities/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madadam/maidsafe_utilities/teams","hooks_url":"https://api.github.com/repos/madadam/maidsafe_utilities/hooks","issue_events_url":"https://api.github.com/repos/madadam/maidsafe_utilities/issues/events{/number}","events_url":"https://api.github.com/repos/madadam/maidsafe_utilities/events","assignees_url":"https://api.github.com/repos/madadam/maidsafe_utilities/assignees{/user}","branches_url":"https://api.github.com/repos/madadam/maidsafe_utilities/branches{/branch}","tags_url":"https://api.github.com/repos/madadam/maidsafe_utilities/tags","blobs_url":"https://api.github.com/repos/madadam/maidsafe_utilities/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madadam/maidsafe_utilities/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madadam/maidsafe_utilities/git/refs{/sha}","trees_url":"https://api.github.com/repos/madadam/maidsafe_utilities/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madadam/maidsafe_utilities/statuses/{sha}","languages_url":"https://api.github.com/repos/madadam/maidsafe_utilities/languages","stargazers_url":"https://api.github.com/repos/madadam/maidsafe_utilities/stargazers","contributors_url":"https://api.github.com/repos/madadam/maidsafe_utilities/contributors","subscribers_url":"https://api.github.com/repos/madadam/maidsafe_utilities/subscribers","subscription_url":"https://api.github.com/repos/madadam/maidsafe_utilities/subscription","commits_url":"https://api.github.com/repos/madadam/maidsafe_utilities/commits{/sha}","git_commits_url":"https://api.github.com/repos/madadam/maidsafe_utilities/git/commits{/sha}","comments_url":"https://api.github.com/repos/madadam/maidsafe_utilities/comments{/number}","issue_comment_url":"https://api.github.com/repos/madadam/maidsafe_utilities/issues/comments{/number}","contents_url":"https://api.github.com/repos/madadam/maidsafe_utilities/contents/{+path}","compare_url":"https://api.github.com/repos/madadam/maidsafe_utilities/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madadam/maidsafe_utilities/merges","archive_url":"https://api.github.com/repos/madadam/maidsafe_utilities/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madadam/maidsafe_utilities/downloads","issues_url":"https://api.github.com/repos/madadam/maidsafe_utilities/issues{/number}","pulls_url":"https://api.github.com/repos/madadam/maidsafe_utilities/pulls{/number}","milestones_url":"https://api.github.com/repos/madadam/maidsafe_utilities/milestones{/number}","notifications_url":"https://api.github.com/repos/madadam/maidsafe_utilities/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madadam/maidsafe_utilities/labels{/name}","releases_url":"https://api.github.com/repos/madadam/maidsafe_utilities/releases{/id}","deployments_url":"https://api.github.com/repos/madadam/maidsafe_utilities/deployments","created_at":"2016-03-03T15:56:15Z","updated_at":"2016-03-03T15:56:16Z","pushed_at":"2016-03-03T16:11:38Z","git_url":"git://github.com/madadam/maidsafe_utilities.git","ssh_url":"git@github.com:madadam/maidsafe_utilities.git","clone_url":"https://github.com/madadam/maidsafe_utilities.git","svn_url":"https://github.com/madadam/maidsafe_utilities","homepage":null,"size":4925,"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":"maidsafe:master","ref":"master","sha":"4d60d623a00879c99cf30a256f44916fd076d580","user":{"login":"maidsafe","id":536423,"avatar_url":"https://avatars.githubusercontent.com/u/536423?v=3","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"repo":{"id":45842514,"name":"maidsafe_utilities","full_name":"maidsafe/maidsafe_utilities","owner":{"login":"maidsafe","id":536423,"avatar_url":"https://avatars.githubusercontent.com/u/536423?v=3","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/maidsafe/maidsafe_utilities","description":"Utility functions","fork":false,"url":"https://api.github.com/repos/maidsafe/maidsafe_utilities","forks_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/forks","keys_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/teams","hooks_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/hooks","issue_events_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/issues/events{/number}","events_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/events","assignees_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/assignees{/user}","branches_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/branches{/branch}","tags_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/tags","blobs_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/git/refs{/sha}","trees_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/statuses/{sha}","languages_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/languages","stargazers_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/stargazers","contributors_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/contributors","subscribers_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/subscribers","subscription_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/subscription","commits_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/commits{/sha}","git_commits_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/git/commits{/sha}","comments_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/comments{/number}","issue_comment_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/issues/comments{/number}","contents_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/contents/{+path}","compare_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/merges","archive_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/downloads","issues_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/issues{/number}","pulls_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls{/number}","milestones_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/milestones{/number}","notifications_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/labels{/name}","releases_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/releases{/id}","deployments_url":"https://api.github.com/repos/maidsafe/maidsafe_utilities/deployments","created_at":"2015-11-09T14:18:45Z","updated_at":"2016-02-12T11:30:18Z","pushed_at":"2016-03-03T16:11:41Z","git_url":"git://github.com/maidsafe/maidsafe_utilities.git","ssh_url":"git@github.com:maidsafe/maidsafe_utilities.git","clone_url":"https://github.com/maidsafe/maidsafe_utilities.git","svn_url":"https://github.com/maidsafe/maidsafe_utilities","homepage":null,"size":4926,"stargazers_count":4,"watchers_count":4,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":2,"forks":11,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32"},"html":{"href":"https://github.com/maidsafe/maidsafe_utilities/pull/32"},"issue":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/issues/32"},"comments":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/maidsafe/maidsafe_utilities/statuses/01b916aca90487bae9ca3303dce950b9fdaefaeb"}}}}