Remove char::to_titlecase. Fix #26555
I added it because it was easy (same a `char::to_lowercase`, just a different table), but it doesn’t make sense to have this in std but not str::to_titlecase, which would require https://github.com/unicode-rs/unicode-segmentation At some point in the future this feature will be available (both on char and str) in a crates.io crate.
This commit is contained in:
@@ -102,29 +102,6 @@ fn test_to_uppercase() {
|
||||
assert_eq!(upper('ᾀ'), ['Ἀ', 'Ι']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_to_titlecase() {
|
||||
fn title(c: char) -> Vec<char> {
|
||||
c.to_titlecase().collect()
|
||||
}
|
||||
assert_eq!(title('a'), ['A']);
|
||||
assert_eq!(title('ö'), ['Ö']);
|
||||
assert_eq!(title('ß'), ['S', 's']); // not ẞ: Latin capital letter sharp s
|
||||
assert_eq!(title('ü'), ['Ü']);
|
||||
assert_eq!(title('💩'), ['💩']);
|
||||
|
||||
assert_eq!(title('σ'), ['Σ']);
|
||||
assert_eq!(title('τ'), ['Τ']);
|
||||
assert_eq!(title('ι'), ['Ι']);
|
||||
assert_eq!(title('γ'), ['Γ']);
|
||||
assert_eq!(title('μ'), ['Μ']);
|
||||
assert_eq!(title('α'), ['Α']);
|
||||
assert_eq!(title('ς'), ['Σ']);
|
||||
assert_eq!(title('DŽ'), ['Dž']);
|
||||
assert_eq!(title('fi'), ['F', 'i']);
|
||||
assert_eq!(title('ᾀ'), ['ᾈ']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_is_control() {
|
||||
assert!('\u{0}'.is_control());
|
||||
|
||||
Reference in New Issue
Block a user