-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document LTR vs RTL wrt trim_* #31202
Conversation
r? @gankro (rust_highfive has picked a reviewer for you, use r? to override) |
Perhaps LTR and RTL could be expanded? Took me a second to figure out what that meant. Or it may be canonical enough and I could just be ignorant. r=me either way! |
I'm not sure this should close #30459: on one hand, it's as good as we can do wrt that issue for now, but, on the other, it'll be easier to lose track of it once we do get the tooling if the issue is closed. Thoughts? |
I'm not sure either... they're canonical for people who talk about text, but do we want to assume that? I'm not sure. @SimonSapin what do you think?
Ah, that's true. I guess I was seeing it through the docs lens, but you're probably right. |
I agree that not every reader of the docs is necessarily familiar with these acronyms, and not using them is easy here. “LTR vs RTL” could be replaced with “Text directionality” for example. |
And yes, not everyone is familiar with text directionality either, but it’s less obscure than acronyms and explained below. |
@bors: r=alexcrichton rollup |
The doc part of rust-lang#30459
Can you add several doctests? For example, according to Wikipedia, a Hebrew word for Hebrew (language) is "עברית" and its romanization is "ivrit". Its last character is "ת" aka "tav" which corresponds to a roman alphabet "t". fn f(s: &str, fc: char, lc: char) {
assert!(fc == s.trim_left().chars().next().unwrap());
assert!(lc == s.trim_right().chars().last().unwrap());
}
fn main() {
f(" English ", 'E', 'h');
f(" עברית ",
'ע',
'ת');
} |
re- r? @alexcrichton I've added the doc tests that @nodakai asked about 👍 |
Fixes rust-lang#30459 Fun fact: i wanted to write "Arabic" and "Hebrew" in Arabic and Hebrew, but vim kept doing the copy/paste in the wrong direction.
@bors: r=alexcrichton rollup I did a dumb thing, and it's fixed now. |
📌 Commit c0ace5d has been approved by |
Fixes rust-lang#30459 Fun fact: i wanted to write "Arabic" and "Hebrew" in Arabic and Hebrew, but vim kept doing the copy/paste in the wrong direction.
Fixes #30459
Fun fact: i wanted to write "Arabic" and "Hebrew" in Arabic and Hebrew, but vim kept doing the copy/paste in the wrong direction.