This will be used as a general interface for displaying things to the user.
The upcoming IncludeMatcher will use it to store its patterns in a
user-displayable string.
Details
Details
- Reviewers
kevincox martinvonz - Group Reviewers
hg-reviewers - Commits
- rHGaa0fc32ece9e: rust-utils: add `Escaped` trait
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
I'm not convinced PrettyPrint is the best name. I might call it something more to do with escaping instead of "pretty". However I can't think of anything great.
rust/hg-core/src/utils.rs | ||
---|---|---|
146 | write!(acc, "\\x{:x}", self).unwrap(); |
Comment Actions
Yeah, I am not convinced either. I've sent a new patch, maybe that's better?
rust/hg-core/src/utils.rs | ||
---|---|---|
146 | Oh nice! |
Comment Actions
I think it's better. Maybe still a little vauge but I'll let subject experts make that decision.
Comment Actions
I'm also not sure about the name, but I don't have a better proposal. We can revisit that later when it's clearer how it will be used.
rust/hg-core/src/utils.rs | ||
---|---|---|
154–157 | i.e. self.iter().flat_map(|item| item.escaped_bytes()).collect()? |
rust/hg-core/src/utils.rs | ||
---|---|---|
154–157 | Sometimes I forget about flat_map. Thanks! |