{"action":"created","issue":{"url":"https://api.github.com/repos/erickt/rust-zmq/issues/78","labels_url":"https://api.github.com/repos/erickt/rust-zmq/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/erickt/rust-zmq/issues/78/comments","events_url":"https://api.github.com/repos/erickt/rust-zmq/issues/78/events","html_url":"https://github.com/erickt/rust-zmq/issues/78","id":103934205,"number":78,"title":"Why &str instead of String?","user":{"login":"petehayes102","id":3638076,"avatar_url":"https://avatars.githubusercontent.com/u/3638076?v=3","gravatar_id":"","url":"https://api.github.com/users/petehayes102","html_url":"https://github.com/petehayes102","followers_url":"https://api.github.com/users/petehayes102/followers","following_url":"https://api.github.com/users/petehayes102/following{/other_user}","gists_url":"https://api.github.com/users/petehayes102/gists{/gist_id}","starred_url":"https://api.github.com/users/petehayes102/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petehayes102/subscriptions","organizations_url":"https://api.github.com/users/petehayes102/orgs","repos_url":"https://api.github.com/users/petehayes102/repos","events_url":"https://api.github.com/users/petehayes102/events{/privacy}","received_events_url":"https://api.github.com/users/petehayes102/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-30T16:55:55Z","updated_at":"2015-08-30T16:58:38Z","closed_at":null,"body":"This is probably my ignorance, but why are you using a str ref for methods like socket.connect instead of String? I normally derive my connection strings from a static protocol and a variable endpoint address, e.g. \"ipc://\" + addr. As far as I'm aware, you can't concatenate two static strings and end up with a static string. And as String.to_str() is not yet stable, wouldn't it make sense to be able to pass a String object instead of a &str?\r\n\r\nWith the current implementation, how would you implement something like this:\r\n\r\nlet conn = format!(\"ipc://{}\", socket_path);\r\nsocket.connect(conn).unwrap();\r\n\r\nTa!"},"comment":{"url":"https://api.github.com/repos/erickt/rust-zmq/issues/comments/136160193","html_url":"https://github.com/erickt/rust-zmq/issues/78#issuecomment-136160193","issue_url":"https://api.github.com/repos/erickt/rust-zmq/issues/78","id":136160193,"user":{"login":"jedisct1","id":124872,"avatar_url":"https://avatars.githubusercontent.com/u/124872?v=3","gravatar_id":"","url":"https://api.github.com/users/jedisct1","html_url":"https://github.com/jedisct1","followers_url":"https://api.github.com/users/jedisct1/followers","following_url":"https://api.github.com/users/jedisct1/following{/other_user}","gists_url":"https://api.github.com/users/jedisct1/gists{/gist_id}","starred_url":"https://api.github.com/users/jedisct1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedisct1/subscriptions","organizations_url":"https://api.github.com/users/jedisct1/orgs","repos_url":"https://api.github.com/users/jedisct1/repos","events_url":"https://api.github.com/users/jedisct1/events{/privacy}","received_events_url":"https://api.github.com/users/jedisct1/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T16:58:38Z","updated_at":"2015-08-30T16:58:38Z","body":"```rust\r\nsocket.connect(&conn).unwrap();\r\n```\r\n\r\nUsing `&str` whenever possible avoids copies."}}