{"action":"created","issue":{"url":"https://api.github.com/repos/ticki/termion/issues/125","repository_url":"https://api.github.com/repos/ticki/termion","labels_url":"https://api.github.com/repos/ticki/termion/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/ticki/termion/issues/125/comments","events_url":"https://api.github.com/repos/ticki/termion/issues/125/events","html_url":"https://github.com/ticki/termion/issues/125","id":263662551,"number":125,"title":"make csi sequences available as &str or String","user":{"login":"little-dude","id":6646324,"avatar_url":"https://avatars2.githubusercontent.com/u/6646324?v=4","gravatar_id":"","url":"https://api.github.com/users/little-dude","html_url":"https://github.com/little-dude","followers_url":"https://api.github.com/users/little-dude/followers","following_url":"https://api.github.com/users/little-dude/following{/other_user}","gists_url":"https://api.github.com/users/little-dude/gists{/gist_id}","starred_url":"https://api.github.com/users/little-dude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/little-dude/subscriptions","organizations_url":"https://api.github.com/users/little-dude/orgs","repos_url":"https://api.github.com/users/little-dude/repos","events_url":"https://api.github.com/users/little-dude/events{/privacy}","received_events_url":"https://api.github.com/users/little-dude/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-07T18:34:42Z","updated_at":"2017-10-07T23:34:36Z","closed_at":"2017-10-07T23:34:36Z","author_association":"NONE","body":"All the CSI sequences are implemented as structs that implement `Display`.\r\nThis is good when you directly write them in a formatter.\r\nHowever, I'd like to build `String`s that contain CSI sequences.\r\nFor now, my only option is to use `format!` and do things like\r\n\r\n```rust\r\nlet mut line: String::from(\"some text, \");\r\nline.push_str(&format!(\"{}\", termion::style::Invert));\r\nline.push_str(\"some selected text\");\r\nline.push_str(&format!(\"{}\", termion::style::Reset));\r\n```\r\n\r\nInstread, I'd like to be able to do something like:\r\n\r\n```rust\r\nlet mut line: String::from(\"some text, \");\r\nline.push_str(termion::style::Invert::as_str());\r\nline.push_str(\"some selected text\");\r\nline.push_str(termion::style::Reset::as_str()));\r\n```\r\n\r\nFor dynamic sequences, like RGB colors, we cannot have `&str` of course, but we could have `String`.\r\n\r\nIf you think you'd accept a PR for this, please let me know, I'll give it a shot."},"comment":{"url":"https://api.github.com/repos/ticki/termion/issues/comments/334972620","html_url":"https://github.com/ticki/termion/issues/125#issuecomment-334972620","issue_url":"https://api.github.com/repos/ticki/termion/issues/125","id":334972620,"user":{"login":"little-dude","id":6646324,"avatar_url":"https://avatars2.githubusercontent.com/u/6646324?v=4","gravatar_id":"","url":"https://api.github.com/users/little-dude","html_url":"https://github.com/little-dude","followers_url":"https://api.github.com/users/little-dude/followers","following_url":"https://api.github.com/users/little-dude/following{/other_user}","gists_url":"https://api.github.com/users/little-dude/gists{/gist_id}","starred_url":"https://api.github.com/users/little-dude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/little-dude/subscriptions","organizations_url":"https://api.github.com/users/little-dude/orgs","repos_url":"https://api.github.com/users/little-dude/repos","events_url":"https://api.github.com/users/little-dude/events{/privacy}","received_events_url":"https://api.github.com/users/little-dude/received_events","type":"User","site_admin":false},"created_at":"2017-10-07T23:34:36Z","updated_at":"2017-10-07T23:34:36Z","author_association":"NONE","body":"this is stupid sorry. `String` implements `core::fmt::Write` so I can just do something like `termion::style::Invert::fmt(&mut line)` in the example above."}}
{"actor":{"display_login":"little-dude"}}