{"action":"created","comment":{"url":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/comments/211654154","pull_request_review_id":148121718,"id":211654154,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTY1NDE1NA==","diff_hunk":"@@ -0,0 +1,117 @@\n+// Copyright 2018 Google Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n+// use this file except in compliance with the License.  You may obtain a copy\n+// of the License at:\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the\n+// License for the specific language governing permissions and limitations\n+// under the License.\n+\n+extern crate env_logger;\n+#[macro_use] extern crate failure;\n+extern crate getopts;\n+extern crate sandboxfs;\n+\n+use failure::Error;\n+use getopts::Options;\n+use std::env;\n+use std::path::Path;\n+use std::process;\n+use std::result::Result;\n+\n+/// Execution failure due to a user-triggered error.\n+#[derive(Debug, Fail)]\n+#[fail(display = \"{}\", message)]\n+struct UsageError {\n+    message: String,\n+}\n+\n+/// Obtains the program name from the execution's first argument, or returns a default if the\n+/// program name cannot be determined for whatever reason.\n+fn program_name(args: &[String], default: &'static str) -> String {\n+    let default = String::from(default);\n+    match args.get(0) {\n+        Some(arg0) => match Path::new(arg0).file_name() {\n+            Some(basename) => match basename.to_str() {\n+                Some(basename) => String::from(basename),\n+                None => default,\n+            },\n+            None => default,\n+        },\n+        None => default,\n+    }\n+}","path":"src/main.rs","position":48,"original_position":48,"commit_id":"dfdfb33d8cfb0b3c3c78411bd5e724a19a19d79c","original_commit_id":"dfdfb33d8cfb0b3c3c78411bd5e724a19a19d79c","user":{"login":"kevincox","id":494012,"node_id":"MDQ6VXNlcjQ5NDAxMg==","avatar_url":"https://avatars1.githubusercontent.com/u/494012?v=4","gravatar_id":"","url":"https://api.github.com/users/kevincox","html_url":"https://github.com/kevincox","followers_url":"https://api.github.com/users/kevincox/followers","following_url":"https://api.github.com/users/kevincox/following{/other_user}","gists_url":"https://api.github.com/users/kevincox/gists{/gist_id}","starred_url":"https://api.github.com/users/kevincox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevincox/subscriptions","organizations_url":"https://api.github.com/users/kevincox/orgs","repos_url":"https://api.github.com/users/kevincox/repos","events_url":"https://api.github.com/users/kevincox/events{/privacy}","received_events_url":"https://api.github.com/users/kevincox/received_events","type":"User","site_admin":false},"body":"Personally I find using the methods on Option much easier to understand: https://rust.godbolt.org/z/sGTXht\r\n\r\nYou can also return a `&str` to save an allocation but it probably isn't worth it in this case: https://rust.godbolt.org/z/7wGCfT","created_at":"2018-08-21T15:36:27Z","updated_at":"2018-08-21T15:43:40Z","html_url":"https://github.com/bazelbuild/sandboxfs/pull/23#discussion_r211654154","pull_request_url":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/comments/211654154"},"html":{"href":"https://github.com/bazelbuild/sandboxfs/pull/23#discussion_r211654154"},"pull_request":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23","id":192524584,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNTI0NTg0","html_url":"https://github.com/bazelbuild/sandboxfs/pull/23","diff_url":"https://github.com/bazelbuild/sandboxfs/pull/23.diff","patch_url":"https://github.com/bazelbuild/sandboxfs/pull/23.patch","issue_url":"https://api.github.com/repos/bazelbuild/sandboxfs/issues/23","number":23,"state":"closed","locked":false,"title":"Add skeleton reimplementation of sandboxfs in Rust","user":{"login":"jmmv","id":879272,"node_id":"MDQ6VXNlcjg3OTI3Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/879272?v=4","gravatar_id":"","url":"https://api.github.com/users/jmmv","html_url":"https://github.com/jmmv","followers_url":"https://api.github.com/users/jmmv/followers","following_url":"https://api.github.com/users/jmmv/following{/other_user}","gists_url":"https://api.github.com/users/jmmv/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmv/subscriptions","organizations_url":"https://api.github.com/users/jmmv/orgs","repos_url":"https://api.github.com/users/jmmv/repos","events_url":"https://api.github.com/users/jmmv/events{/privacy}","received_events_url":"https://api.github.com/users/jmmv/received_events","type":"User","site_admin":false},"body":"This change adds a barebones reimplementation of sandboxfs in Rust.\r\nAs things are now, the new version does nothing: it just provides\r\ntrivial command-line processing and mounts an empty FUSE file\r\nsystem.\r\n\r\nHowever, this change puts all pieces in place to continue development\r\nof this new version.  In particular, this adjusts the Travis CI\r\nconfiguration to support running the exact same integration tests as\r\nwe run for the Go implementation against the new code, and currently\r\nblacklists all of them because the new code passes none.","created_at":"2018-06-04T20:51:11Z","updated_at":"2018-08-21T15:43:40Z","closed_at":"2018-08-03T15:47:56Z","merged_at":"2018-08-03T15:47:56Z","merge_commit_sha":"0b78fae7b99082907b64e9f867ea7cfe10c22a64","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23/commits","review_comments_url":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23/comments","review_comment_url":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bazelbuild/sandboxfs/issues/23/comments","statuses_url":"https://api.github.com/repos/bazelbuild/sandboxfs/statuses/dfdfb33d8cfb0b3c3c78411bd5e724a19a19d79c","head":{"label":"jmmv:rust","ref":"rust","sha":"dfdfb33d8cfb0b3c3c78411bd5e724a19a19d79c","user":{"login":"jmmv","id":879272,"node_id":"MDQ6VXNlcjg3OTI3Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/879272?v=4","gravatar_id":"","url":"https://api.github.com/users/jmmv","html_url":"https://github.com/jmmv","followers_url":"https://api.github.com/users/jmmv/followers","following_url":"https://api.github.com/users/jmmv/following{/other_user}","gists_url":"https://api.github.com/users/jmmv/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmv/subscriptions","organizations_url":"https://api.github.com/users/jmmv/orgs","repos_url":"https://api.github.com/users/jmmv/repos","events_url":"https://api.github.com/users/jmmv/events{/privacy}","received_events_url":"https://api.github.com/users/jmmv/received_events","type":"User","site_admin":false},"repo":{"id":103277477,"node_id":"MDEwOlJlcG9zaXRvcnkxMDMyNzc0Nzc=","name":"sandboxfs","full_name":"jmmv/sandboxfs","owner":{"login":"jmmv","id":879272,"node_id":"MDQ6VXNlcjg3OTI3Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/879272?v=4","gravatar_id":"","url":"https://api.github.com/users/jmmv","html_url":"https://github.com/jmmv","followers_url":"https://api.github.com/users/jmmv/followers","following_url":"https://api.github.com/users/jmmv/following{/other_user}","gists_url":"https://api.github.com/users/jmmv/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmv/subscriptions","organizations_url":"https://api.github.com/users/jmmv/orgs","repos_url":"https://api.github.com/users/jmmv/repos","events_url":"https://api.github.com/users/jmmv/events{/privacy}","received_events_url":"https://api.github.com/users/jmmv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmmv/sandboxfs","description":"A virtual file system for sandboxing","fork":true,"url":"https://api.github.com/repos/jmmv/sandboxfs","forks_url":"https://api.github.com/repos/jmmv/sandboxfs/forks","keys_url":"https://api.github.com/repos/jmmv/sandboxfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmmv/sandboxfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmmv/sandboxfs/teams","hooks_url":"https://api.github.com/repos/jmmv/sandboxfs/hooks","issue_events_url":"https://api.github.com/repos/jmmv/sandboxfs/issues/events{/number}","events_url":"https://api.github.com/repos/jmmv/sandboxfs/events","assignees_url":"https://api.github.com/repos/jmmv/sandboxfs/assignees{/user}","branches_url":"https://api.github.com/repos/jmmv/sandboxfs/branches{/branch}","tags_url":"https://api.github.com/repos/jmmv/sandboxfs/tags","blobs_url":"https://api.github.com/repos/jmmv/sandboxfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmmv/sandboxfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmmv/sandboxfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmmv/sandboxfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmmv/sandboxfs/statuses/{sha}","languages_url":"https://api.github.com/repos/jmmv/sandboxfs/languages","stargazers_url":"https://api.github.com/repos/jmmv/sandboxfs/stargazers","contributors_url":"https://api.github.com/repos/jmmv/sandboxfs/contributors","subscribers_url":"https://api.github.com/repos/jmmv/sandboxfs/subscribers","subscription_url":"https://api.github.com/repos/jmmv/sandboxfs/subscription","commits_url":"https://api.github.com/repos/jmmv/sandboxfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmmv/sandboxfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmmv/sandboxfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmmv/sandboxfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmmv/sandboxfs/contents/{+path}","compare_url":"https://api.github.com/repos/jmmv/sandboxfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmmv/sandboxfs/merges","archive_url":"https://api.github.com/repos/jmmv/sandboxfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmmv/sandboxfs/downloads","issues_url":"https://api.github.com/repos/jmmv/sandboxfs/issues{/number}","pulls_url":"https://api.github.com/repos/jmmv/sandboxfs/pulls{/number}","milestones_url":"https://api.github.com/repos/jmmv/sandboxfs/milestones{/number}","notifications_url":"https://api.github.com/repos/jmmv/sandboxfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmmv/sandboxfs/labels{/name}","releases_url":"https://api.github.com/repos/jmmv/sandboxfs/releases{/id}","deployments_url":"https://api.github.com/repos/jmmv/sandboxfs/deployments","created_at":"2017-09-12T13:56:08Z","updated_at":"2018-08-21T13:13:12Z","pushed_at":"2018-08-21T13:13:10Z","git_url":"git://github.com/jmmv/sandboxfs.git","ssh_url":"git@github.com:jmmv/sandboxfs.git","clone_url":"https://github.com/jmmv/sandboxfs.git","svn_url":"https://github.com/jmmv/sandboxfs","homepage":"","size":345,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bazelbuild:master","ref":"master","sha":"547f6e1b8d86706c77e0dfab3cb56c3c9b5e8e10","user":{"login":"bazelbuild","id":11684617,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjg0NjE3","avatar_url":"https://avatars1.githubusercontent.com/u/11684617?v=4","gravatar_id":"","url":"https://api.github.com/users/bazelbuild","html_url":"https://github.com/bazelbuild","followers_url":"https://api.github.com/users/bazelbuild/followers","following_url":"https://api.github.com/users/bazelbuild/following{/other_user}","gists_url":"https://api.github.com/users/bazelbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/bazelbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazelbuild/subscriptions","organizations_url":"https://api.github.com/users/bazelbuild/orgs","repos_url":"https://api.github.com/users/bazelbuild/repos","events_url":"https://api.github.com/users/bazelbuild/events{/privacy}","received_events_url":"https://api.github.com/users/bazelbuild/received_events","type":"Organization","site_admin":false},"repo":{"id":101425662,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE0MjU2NjI=","name":"sandboxfs","full_name":"bazelbuild/sandboxfs","owner":{"login":"bazelbuild","id":11684617,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjg0NjE3","avatar_url":"https://avatars1.githubusercontent.com/u/11684617?v=4","gravatar_id":"","url":"https://api.github.com/users/bazelbuild","html_url":"https://github.com/bazelbuild","followers_url":"https://api.github.com/users/bazelbuild/followers","following_url":"https://api.github.com/users/bazelbuild/following{/other_user}","gists_url":"https://api.github.com/users/bazelbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/bazelbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazelbuild/subscriptions","organizations_url":"https://api.github.com/users/bazelbuild/orgs","repos_url":"https://api.github.com/users/bazelbuild/repos","events_url":"https://api.github.com/users/bazelbuild/events{/privacy}","received_events_url":"https://api.github.com/users/bazelbuild/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bazelbuild/sandboxfs","description":"A virtual file system for sandboxing","fork":false,"url":"https://api.github.com/repos/bazelbuild/sandboxfs","forks_url":"https://api.github.com/repos/bazelbuild/sandboxfs/forks","keys_url":"https://api.github.com/repos/bazelbuild/sandboxfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bazelbuild/sandboxfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bazelbuild/sandboxfs/teams","hooks_url":"https://api.github.com/repos/bazelbuild/sandboxfs/hooks","issue_events_url":"https://api.github.com/repos/bazelbuild/sandboxfs/issues/events{/number}","events_url":"https://api.github.com/repos/bazelbuild/sandboxfs/events","assignees_url":"https://api.github.com/repos/bazelbuild/sandboxfs/assignees{/user}","branches_url":"https://api.github.com/repos/bazelbuild/sandboxfs/branches{/branch}","tags_url":"https://api.github.com/repos/bazelbuild/sandboxfs/tags","blobs_url":"https://api.github.com/repos/bazelbuild/sandboxfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bazelbuild/sandboxfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bazelbuild/sandboxfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bazelbuild/sandboxfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bazelbuild/sandboxfs/statuses/{sha}","languages_url":"https://api.github.com/repos/bazelbuild/sandboxfs/languages","stargazers_url":"https://api.github.com/repos/bazelbuild/sandboxfs/stargazers","contributors_url":"https://api.github.com/repos/bazelbuild/sandboxfs/contributors","subscribers_url":"https://api.github.com/repos/bazelbuild/sandboxfs/subscribers","subscription_url":"https://api.github.com/repos/bazelbuild/sandboxfs/subscription","commits_url":"https://api.github.com/repos/bazelbuild/sandboxfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bazelbuild/sandboxfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bazelbuild/sandboxfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bazelbuild/sandboxfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/bazelbuild/sandboxfs/contents/{+path}","compare_url":"https://api.github.com/repos/bazelbuild/sandboxfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bazelbuild/sandboxfs/merges","archive_url":"https://api.github.com/repos/bazelbuild/sandboxfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bazelbuild/sandboxfs/downloads","issues_url":"https://api.github.com/repos/bazelbuild/sandboxfs/issues{/number}","pulls_url":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls{/number}","milestones_url":"https://api.github.com/repos/bazelbuild/sandboxfs/milestones{/number}","notifications_url":"https://api.github.com/repos/bazelbuild/sandboxfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bazelbuild/sandboxfs/labels{/name}","releases_url":"https://api.github.com/repos/bazelbuild/sandboxfs/releases{/id}","deployments_url":"https://api.github.com/repos/bazelbuild/sandboxfs/deployments","created_at":"2017-08-25T17:12:51Z","updated_at":"2018-08-21T13:12:47Z","pushed_at":"2018-08-21T13:12:46Z","git_url":"git://github.com/bazelbuild/sandboxfs.git","ssh_url":"git@github.com:bazelbuild/sandboxfs.git","clone_url":"https://github.com/bazelbuild/sandboxfs.git","svn_url":"https://github.com/bazelbuild/sandboxfs","homepage":"","size":351,"stargazers_count":77,"watchers_count":77,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":9,"open_issues":0,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23"},"html":{"href":"https://github.com/bazelbuild/sandboxfs/pull/23"},"issue":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/issues/23"},"comments":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/bazelbuild/sandboxfs/statuses/dfdfb33d8cfb0b3c3c78411bd5e724a19a19d79c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kevincox"}}