{"action":"created","issue":{"url":"https://api.github.com/repos/Gilnaa/globwalk/issues/1","repository_url":"https://api.github.com/repos/Gilnaa/globwalk","labels_url":"https://api.github.com/repos/Gilnaa/globwalk/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Gilnaa/globwalk/issues/1/comments","events_url":"https://api.github.com/repos/Gilnaa/globwalk/issues/1/events","html_url":"https://github.com/Gilnaa/globwalk/issues/1","id":300056150,"number":1,"title":"API feedback","user":{"login":"Keats","id":680355,"avatar_url":"https://avatars2.githubusercontent.com/u/680355?v=4","gravatar_id":"","url":"https://api.github.com/users/Keats","html_url":"https://github.com/Keats","followers_url":"https://api.github.com/users/Keats/followers","following_url":"https://api.github.com/users/Keats/following{/other_user}","gists_url":"https://api.github.com/users/Keats/gists{/gist_id}","starred_url":"https://api.github.com/users/Keats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keats/subscriptions","organizations_url":"https://api.github.com/users/Keats/orgs","repos_url":"https://api.github.com/users/Keats/repos","events_url":"https://api.github.com/users/Keats/events{/privacy}","received_events_url":"https://api.github.com/users/Keats/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-25T20:04:16Z","updated_at":"2018-03-03T12:51:47Z","closed_at":"2018-03-02T12:59:27Z","author_association":"NONE","body":"I just tried `globwalk` after reading https://github.com/Keats/tera/issues/212 and the globset PR associated.\r\n\r\nFirst: the example in the README does not compile.\r\n\r\nSecond, I think an API like this would be nicer:\r\n\r\n```rust\r\n// not going to actually write the code\r\nstruct GlobWalk {}\r\n\r\nimpl GlobWalk {\r\n // takes a single pattern and assume current  dir -> like `glob` and the python `glob` (https://docs.python.org/3/library/glob.html)\r\n  pub fn new(pat: &str) -> Result<Self, Error> {}\r\n\r\n  // same as current one, minus the base directory\r\n  pub fn from_patterns(pat: &[S]) -> Result<Self, Error> {}\r\n\r\n  pub base_directory(&mut self, dir: &str) -> Self {}\r\n\r\n // rest of the builder similar to currently\r\n}\r\n```\r\n\r\nThe main advantage with that API is simplicity for the common case: find everything matching in a single given pattern for the cwd. This is how `glob` works in pretty much every languages I know (including Rust) and that would be weird to change that.\r\nI see \"glob searches for files in the current working directory, whereas globwalk starts at a specified base-dir.\" in the README but doesn't really explain why.\r\n\r\nI'd be happy to implement that in a PR if you agree."},"comment":{"url":"https://api.github.com/repos/Gilnaa/globwalk/issues/comments/370145418","html_url":"https://github.com/Gilnaa/globwalk/issues/1#issuecomment-370145418","issue_url":"https://api.github.com/repos/Gilnaa/globwalk/issues/1","id":370145418,"user":{"login":"Keats","id":680355,"avatar_url":"https://avatars2.githubusercontent.com/u/680355?v=4","gravatar_id":"","url":"https://api.github.com/users/Keats","html_url":"https://github.com/Keats","followers_url":"https://api.github.com/users/Keats/followers","following_url":"https://api.github.com/users/Keats/following{/other_user}","gists_url":"https://api.github.com/users/Keats/gists{/gist_id}","starred_url":"https://api.github.com/users/Keats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keats/subscriptions","organizations_url":"https://api.github.com/users/Keats/orgs","repos_url":"https://api.github.com/users/Keats/repos","events_url":"https://api.github.com/users/Keats/events{/privacy}","received_events_url":"https://api.github.com/users/Keats/received_events","type":"User","site_admin":false},"created_at":"2018-03-03T12:51:47Z","updated_at":"2018-03-03T12:51:47Z","author_association":"NONE","body":"> Can't say I feel one way or the other about the glob fn, is it something to do with API parity with the glob crate?\r\n\r\nYes, in most languages `glob` is a simple fn and I expect the majority of people to be using only that. No need to expose a struct if it's not needed for the common case."}}
{"actor":{"display_login":"Keats"}}