{"action":"created","comment":{"url":"https://api.github.com/repos/matthiasbeyer/imag/pulls/comments/52104282","id":52104282,"diff_hunk":"@@ -0,0 +1,50 @@\n+use std::convert::Into;\n+\n+use regex::Regex;\n+use regex::Error as RError;\n+\n+use libimagstore::store::Entry;\n+\n+use builtin::header::field_path::FieldPath;\n+use filter::Filter;\n+\n+pub trait IntoRegex {\n+\n+    fn into_regex(self) -> Result<Regex, RError>;\n+\n+}\n+\n+impl<'a> IntoRegex for &'a str {\n+\n+    fn into_regex(self) -> Result<Regex, RError> {\n+        Regex::new(self)\n+    }\n+}\n+","path":"libimagentryfilter/src/builtin/content/grep.rs","position":23,"original_position":23,"commit_id":"9905cd42c66c68c62c63d4b346617c5ab104bf4c","original_commit_id":"9905cd42c66c68c62c63d4b346617c5ab104bf4c","user":{"login":"TheNeikos","id":1631166,"avatar_url":"https://avatars.githubusercontent.com/u/1631166?v=3","gravatar_id":"","url":"https://api.github.com/users/TheNeikos","html_url":"https://github.com/TheNeikos","followers_url":"https://api.github.com/users/TheNeikos/followers","following_url":"https://api.github.com/users/TheNeikos/following{/other_user}","gists_url":"https://api.github.com/users/TheNeikos/gists{/gist_id}","starred_url":"https://api.github.com/users/TheNeikos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheNeikos/subscriptions","organizations_url":"https://api.github.com/users/TheNeikos/orgs","repos_url":"https://api.github.com/users/TheNeikos/repos","events_url":"https://api.github.com/users/TheNeikos/events{/privacy}","received_events_url":"https://api.github.com/users/TheNeikos/received_events","type":"User","site_admin":false},"body":"Also implement it for Regex as well.","created_at":"2016-02-06T17:03:23Z","updated_at":"2016-02-06T17:03:23Z","html_url":"https://github.com/matthiasbeyer/imag/pull/170#discussion_r52104282","pull_request_url":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/matthiasbeyer/imag/pulls/comments/52104282"},"html":{"href":"https://github.com/matthiasbeyer/imag/pull/170#discussion_r52104282"},"pull_request":{"href":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170","id":58011907,"html_url":"https://github.com/matthiasbeyer/imag/pull/170","diff_url":"https://github.com/matthiasbeyer/imag/pull/170.diff","patch_url":"https://github.com/matthiasbeyer/imag/pull/170.patch","issue_url":"https://api.github.com/repos/matthiasbeyer/imag/issues/170","number":170,"state":"open","locked":false,"title":"Libimagentryfilter/init","user":{"login":"matthiasbeyer","id":427866,"avatar_url":"https://avatars.githubusercontent.com/u/427866?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasbeyer","html_url":"https://github.com/matthiasbeyer","followers_url":"https://api.github.com/users/matthiasbeyer/followers","following_url":"https://api.github.com/users/matthiasbeyer/following{/other_user}","gists_url":"https://api.github.com/users/matthiasbeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasbeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasbeyer/subscriptions","organizations_url":"https://api.github.com/users/matthiasbeyer/orgs","repos_url":"https://api.github.com/users/matthiasbeyer/repos","events_url":"https://api.github.com/users/matthiasbeyer/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasbeyer/received_events","type":"User","site_admin":false},"body":"New library to build filters for entries.\r\n\r\nCovers:\r\n\r\n- [ ] Filter types\r\n  - [x] Callable for the user with `entries.iter().filter(|e| filter.filter(e)).collect();`\r\n  - [x] Constructable with `SomeFilter::new().and(SomeOtherFilter::new())`, so basic operators are included\r\n    - [x] `::and()`\r\n    - [x] `::or()`\r\n    - [x] `::not()`\r\n  - [ ] Builtin filters\r\n    - [x] Header filters\r\n      - [x] Header field equals X\r\n      - [x] Header field grep\r\n      - [x] Header field is type\r\n      - [x] Header field is set (Bool -> bool, else true)\r\n      - [x] Header field is empty (Null -> true, Array, Table)\r\n    - [ ] Content filter\r\n      - [x] Grep\r\n      - [x] Length\r\n      - [ ] Links in text\r\n- [ ] CLI-Helper to build Filters from a commandline spec (a String, actually)\r\n  - [ ] Language Specification\r\n  - [ ] Tokenizer\r\n  - [ ] Filter builder\r\n  - [ ] Language extensions (let the user of the library implement custom syntax elements)","created_at":"2016-02-02T16:30:37Z","updated_at":"2016-02-06T17:03:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f13f284f2bb135acd971133c9b9cf1b3b5b4a2a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170/commits","review_comments_url":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170/comments","review_comment_url":"https://api.github.com/repos/matthiasbeyer/imag/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matthiasbeyer/imag/issues/170/comments","statuses_url":"https://api.github.com/repos/matthiasbeyer/imag/statuses/9905cd42c66c68c62c63d4b346617c5ab104bf4c","head":{"label":"matthiasbeyer:libimagentryfilter/init","ref":"libimagentryfilter/init","sha":"9905cd42c66c68c62c63d4b346617c5ab104bf4c","user":{"login":"matthiasbeyer","id":427866,"avatar_url":"https://avatars.githubusercontent.com/u/427866?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasbeyer","html_url":"https://github.com/matthiasbeyer","followers_url":"https://api.github.com/users/matthiasbeyer/followers","following_url":"https://api.github.com/users/matthiasbeyer/following{/other_user}","gists_url":"https://api.github.com/users/matthiasbeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasbeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasbeyer/subscriptions","organizations_url":"https://api.github.com/users/matthiasbeyer/orgs","repos_url":"https://api.github.com/users/matthiasbeyer/repos","events_url":"https://api.github.com/users/matthiasbeyer/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasbeyer/received_events","type":"User","site_admin":false},"repo":{"id":45788713,"name":"imag","full_name":"matthiasbeyer/imag","owner":{"login":"matthiasbeyer","id":427866,"avatar_url":"https://avatars.githubusercontent.com/u/427866?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasbeyer","html_url":"https://github.com/matthiasbeyer","followers_url":"https://api.github.com/users/matthiasbeyer/followers","following_url":"https://api.github.com/users/matthiasbeyer/following{/other_user}","gists_url":"https://api.github.com/users/matthiasbeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasbeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasbeyer/subscriptions","organizations_url":"https://api.github.com/users/matthiasbeyer/orgs","repos_url":"https://api.github.com/users/matthiasbeyer/repos","events_url":"https://api.github.com/users/matthiasbeyer/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasbeyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matthiasbeyer/imag","description":"imag - Text based personal information management suite","fork":false,"url":"https://api.github.com/repos/matthiasbeyer/imag","forks_url":"https://api.github.com/repos/matthiasbeyer/imag/forks","keys_url":"https://api.github.com/repos/matthiasbeyer/imag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthiasbeyer/imag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthiasbeyer/imag/teams","hooks_url":"https://api.github.com/repos/matthiasbeyer/imag/hooks","issue_events_url":"https://api.github.com/repos/matthiasbeyer/imag/issues/events{/number}","events_url":"https://api.github.com/repos/matthiasbeyer/imag/events","assignees_url":"https://api.github.com/repos/matthiasbeyer/imag/assignees{/user}","branches_url":"https://api.github.com/repos/matthiasbeyer/imag/branches{/branch}","tags_url":"https://api.github.com/repos/matthiasbeyer/imag/tags","blobs_url":"https://api.github.com/repos/matthiasbeyer/imag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthiasbeyer/imag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthiasbeyer/imag/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthiasbeyer/imag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthiasbeyer/imag/statuses/{sha}","languages_url":"https://api.github.com/repos/matthiasbeyer/imag/languages","stargazers_url":"https://api.github.com/repos/matthiasbeyer/imag/stargazers","contributors_url":"https://api.github.com/repos/matthiasbeyer/imag/contributors","subscribers_url":"https://api.github.com/repos/matthiasbeyer/imag/subscribers","subscription_url":"https://api.github.com/repos/matthiasbeyer/imag/subscription","commits_url":"https://api.github.com/repos/matthiasbeyer/imag/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthiasbeyer/imag/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthiasbeyer/imag/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthiasbeyer/imag/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthiasbeyer/imag/contents/{+path}","compare_url":"https://api.github.com/repos/matthiasbeyer/imag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthiasbeyer/imag/merges","archive_url":"https://api.github.com/repos/matthiasbeyer/imag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthiasbeyer/imag/downloads","issues_url":"https://api.github.com/repos/matthiasbeyer/imag/issues{/number}","pulls_url":"https://api.github.com/repos/matthiasbeyer/imag/pulls{/number}","milestones_url":"https://api.github.com/repos/matthiasbeyer/imag/milestones{/number}","notifications_url":"https://api.github.com/repos/matthiasbeyer/imag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthiasbeyer/imag/labels{/name}","releases_url":"https://api.github.com/repos/matthiasbeyer/imag/releases{/id}","deployments_url":"https://api.github.com/repos/matthiasbeyer/imag/deployments","created_at":"2015-11-08T16:34:25Z","updated_at":"2016-01-31T22:17:21Z","pushed_at":"2016-02-06T10:56:04Z","git_url":"git://github.com/matthiasbeyer/imag.git","ssh_url":"git@github.com:matthiasbeyer/imag.git","clone_url":"https://github.com/matthiasbeyer/imag.git","svn_url":"https://github.com/matthiasbeyer/imag","homepage":"","size":670,"stargazers_count":6,"watchers_count":6,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":25,"forks":2,"open_issues":25,"watchers":6,"default_branch":"master"}},"base":{"label":"matthiasbeyer:master","ref":"master","sha":"fa5d1553ddbb253f2df3de2754957bc6e276c37d","user":{"login":"matthiasbeyer","id":427866,"avatar_url":"https://avatars.githubusercontent.com/u/427866?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasbeyer","html_url":"https://github.com/matthiasbeyer","followers_url":"https://api.github.com/users/matthiasbeyer/followers","following_url":"https://api.github.com/users/matthiasbeyer/following{/other_user}","gists_url":"https://api.github.com/users/matthiasbeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasbeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasbeyer/subscriptions","organizations_url":"https://api.github.com/users/matthiasbeyer/orgs","repos_url":"https://api.github.com/users/matthiasbeyer/repos","events_url":"https://api.github.com/users/matthiasbeyer/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasbeyer/received_events","type":"User","site_admin":false},"repo":{"id":45788713,"name":"imag","full_name":"matthiasbeyer/imag","owner":{"login":"matthiasbeyer","id":427866,"avatar_url":"https://avatars.githubusercontent.com/u/427866?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasbeyer","html_url":"https://github.com/matthiasbeyer","followers_url":"https://api.github.com/users/matthiasbeyer/followers","following_url":"https://api.github.com/users/matthiasbeyer/following{/other_user}","gists_url":"https://api.github.com/users/matthiasbeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasbeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasbeyer/subscriptions","organizations_url":"https://api.github.com/users/matthiasbeyer/orgs","repos_url":"https://api.github.com/users/matthiasbeyer/repos","events_url":"https://api.github.com/users/matthiasbeyer/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasbeyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matthiasbeyer/imag","description":"imag - Text based personal information management suite","fork":false,"url":"https://api.github.com/repos/matthiasbeyer/imag","forks_url":"https://api.github.com/repos/matthiasbeyer/imag/forks","keys_url":"https://api.github.com/repos/matthiasbeyer/imag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthiasbeyer/imag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthiasbeyer/imag/teams","hooks_url":"https://api.github.com/repos/matthiasbeyer/imag/hooks","issue_events_url":"https://api.github.com/repos/matthiasbeyer/imag/issues/events{/number}","events_url":"https://api.github.com/repos/matthiasbeyer/imag/events","assignees_url":"https://api.github.com/repos/matthiasbeyer/imag/assignees{/user}","branches_url":"https://api.github.com/repos/matthiasbeyer/imag/branches{/branch}","tags_url":"https://api.github.com/repos/matthiasbeyer/imag/tags","blobs_url":"https://api.github.com/repos/matthiasbeyer/imag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthiasbeyer/imag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthiasbeyer/imag/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthiasbeyer/imag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthiasbeyer/imag/statuses/{sha}","languages_url":"https://api.github.com/repos/matthiasbeyer/imag/languages","stargazers_url":"https://api.github.com/repos/matthiasbeyer/imag/stargazers","contributors_url":"https://api.github.com/repos/matthiasbeyer/imag/contributors","subscribers_url":"https://api.github.com/repos/matthiasbeyer/imag/subscribers","subscription_url":"https://api.github.com/repos/matthiasbeyer/imag/subscription","commits_url":"https://api.github.com/repos/matthiasbeyer/imag/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthiasbeyer/imag/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthiasbeyer/imag/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthiasbeyer/imag/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthiasbeyer/imag/contents/{+path}","compare_url":"https://api.github.com/repos/matthiasbeyer/imag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthiasbeyer/imag/merges","archive_url":"https://api.github.com/repos/matthiasbeyer/imag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthiasbeyer/imag/downloads","issues_url":"https://api.github.com/repos/matthiasbeyer/imag/issues{/number}","pulls_url":"https://api.github.com/repos/matthiasbeyer/imag/pulls{/number}","milestones_url":"https://api.github.com/repos/matthiasbeyer/imag/milestones{/number}","notifications_url":"https://api.github.com/repos/matthiasbeyer/imag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthiasbeyer/imag/labels{/name}","releases_url":"https://api.github.com/repos/matthiasbeyer/imag/releases{/id}","deployments_url":"https://api.github.com/repos/matthiasbeyer/imag/deployments","created_at":"2015-11-08T16:34:25Z","updated_at":"2016-01-31T22:17:21Z","pushed_at":"2016-02-06T10:56:04Z","git_url":"git://github.com/matthiasbeyer/imag.git","ssh_url":"git@github.com:matthiasbeyer/imag.git","clone_url":"https://github.com/matthiasbeyer/imag.git","svn_url":"https://github.com/matthiasbeyer/imag","homepage":"","size":670,"stargazers_count":6,"watchers_count":6,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":25,"forks":2,"open_issues":25,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170"},"html":{"href":"https://github.com/matthiasbeyer/imag/pull/170"},"issue":{"href":"https://api.github.com/repos/matthiasbeyer/imag/issues/170"},"comments":{"href":"https://api.github.com/repos/matthiasbeyer/imag/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/matthiasbeyer/imag/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matthiasbeyer/imag/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/matthiasbeyer/imag/statuses/9905cd42c66c68c62c63d4b346617c5ab104bf4c"}}}}